Examples of bodyDeclarations()


Examples of org.eclipse.jdt.core.dom.EnumDeclaration.bodyDeclarations()

                /*
                 * It would be nice to be able to reuse the convenience methods from AbstractTypeDeclaration,
                 * but they don't exist in EnumDeclaration.  So we improvise!
                 */

                List<BodyDeclaration> bodyDecls = enumDeclaration.bodyDeclarations();
                for (BodyDeclaration bodyDecl : bodyDecls) {
                    if (bodyDecl instanceof FieldDeclaration) {
                        // fields of the class top level type
                        FieldMetadata fieldMetadata = getFieldMetadataFrom((FieldDeclaration)bodyDecl);
                        enumMetadata.getFields().add(fieldMetadata);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

            m_parser.setSource(buff.toString().toCharArray());
            CompilationUnit unit = (CompilationUnit)m_parser.createAST(null);
           
            // add all methods from output tree to class under construction
            TypeDeclaration typedecl = (TypeDeclaration)unit.types().get(0);
            for (Iterator iter = typedecl.bodyDeclarations().iterator(); iter.hasNext();) {
                ASTNode node = (ASTNode)iter.next();
                if (node instanceof MethodDeclaration) {
                    holder.addMethod((MethodDeclaration)node);
                }
            }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

            // parse class text to get field declaration
            String text = "class gorph { private static final long serialVersionUID = " + m_serialVersion + "; }";
            m_parser.setSource(text.toCharArray());
            CompilationUnit unit = (CompilationUnit)m_parser.createAST(null);
            TypeDeclaration type = (TypeDeclaration)unit.types().get(0);
            FieldDeclaration field = (FieldDeclaration)type.bodyDeclarations().get(0);
            holder.addField(field);
           
        }
    }
   
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

            type.setJavadoc(comment);
            type.setInterface(false);
            type.modifiers()
                .add(ast.newModifier(Modifier.ModifierKeyword.PUBLIC_KEYWORD));
            type.setName(ast.newSimpleName(className));
            type.bodyDeclarations().add(
                BodyDeclaration.copySubtree(type.getAST(),
                    methodDec));
            unit.types().add(type);

            String source = unit.toString();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

        // Remote all interfaces
        aRemoteService.superInterfaceTypes().clear();

        // Change methods, fields and inner classes
        List bodyDeclarations = aRemoteService.bodyDeclarations();
        List declarationsToDelete = new ArrayList();
        for (Iterator k = bodyDeclarations.iterator(); k.hasNext();) {

          Object currDeclaration = k.next();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

       
        // Remote all interfaces
        aRemoteService.superInterfaceTypes().clear();
       
        // Change methods, fields and inner classes
        List bodyDeclarations = aRemoteService.bodyDeclarations();
        List declarationsToDelete = new ArrayList();
        for (Iterator k = bodyDeclarations.iterator(); k.hasNext();) {
         
          Object currDeclaration = k.next();
         
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

        ReturnStatement returnStatement = ast.newReturnStatement();
        returnStatement.setExpression(methodInvocation);

        block.statements().add(returnStatement); //add the return statement to the block
        newMethod.setBody(block); // add the block to the method
        newType.bodyDeclarations().add(newMethod); //add the method to the type
       
      }
      if (method.getName().getIdentifier().startsWith("set")) {
        List<SingleVariableDeclaration> parameters = method.parameters();
        if (parameters.size() != 1)
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

       
        ExpressionStatement expressionStatement = ast.newExpressionStatement(methodInvocation);
        block.statements().add(expressionStatement);
         
        newMethod.setBody(block); // add the block to the method
        newType.bodyDeclarations().add(newMethod); //add the method to the type
       
      }
    }
   
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

    aRemoteService.superInterfaceTypes().clear();

    updateModifier(aRemoteService);

    // Change methods, fields and inner classes
    List bodyDeclarations = aRemoteService.bodyDeclarations();
    List declarationsToDelete = new ArrayList();
    for (Iterator k = bodyDeclarations.iterator(); k.hasNext();) {

      Object currDeclaration = k.next();
View Full Code Here

Examples of org.eclipse.jdt.core.dom.TypeDeclaration.bodyDeclarations()

       
        // Remote all interfaces
        aRemoteService.superInterfaceTypes().clear();
       
        // Change methods, fields and inner classes
        List bodyDeclarations = aRemoteService.bodyDeclarations();
        List declarationsToDelete = new ArrayList();
        for (Iterator k = bodyDeclarations.iterator(); k.hasNext();) {
         
          Object currDeclaration = k.next();
         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.