Package org.eclipse.jdt.core.dom

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


            AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU);
            if (typeNode != null) {
              // rename type
              rewriter.replace(typeNode.getName(), ast.newSimpleName(newTypeName), null);
              // rename constructors
              Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
              while (bodyDeclarations.hasNext()) {
                Object bodyDeclaration = bodyDeclarations.next();
                if (bodyDeclaration instanceof MethodDeclaration) {
                  MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration;
                  if (methodDeclaration.isConstructor()) {
View Full Code Here


        }
        return true;
      }

      public boolean visit(TypeDeclaration typeDeclaration) {
        List bodyDeclarations = typeDeclaration.bodyDeclarations();
        for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
          BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
          bodyDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
          typeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
        }
View Full Code Here

      public boolean visit(TypeDeclaration typeDeclaration) {
        if (checkMalformedNodes(typeDeclaration)) {
          return true; // abort sorting of current element
        }

        sortElements(typeDeclaration.bodyDeclarations(), rewriter.getListRewrite(typeDeclaration, TypeDeclaration.BODY_DECLARATIONS_PROPERTY));
        return true;
      }

      public boolean visit(EnumDeclaration enumDeclaration) {
        if (checkMalformedNodes(enumDeclaration)) {
View Full Code Here

            AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU);
            if (typeNode != null) {
              // rename type
              rewriter.replace(typeNode.getName(), ast.newSimpleName(newTypeName), null);
              // rename constructors
              Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
              while (bodyDeclarations.hasNext()) {
                Object bodyDeclaration = bodyDeclarations.next();
                if (bodyDeclaration instanceof MethodDeclaration) {
                  MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration;
                  if (methodDeclaration.isConstructor()) {
View Full Code Here

    parser.setResolveBindings(true); // we need bindings later on
    CompilationUnit cu = (CompilationUnit) parser.createAST(null);
//    List types = cu.structuralPropertiesForType();
    for(Object o:cu.types()){
      AbstractTypeDeclaration dec = (AbstractTypeDeclaration) o;
      List bodyDeclarations = dec.bodyDeclarations();
      assertNotNull(dec.resolveBinding());
      for(Object body:bodyDeclarations){
        MethodDeclaration methodDec = (MethodDeclaration) body;
        IMethodBinding binding = methodDec.resolveBinding();
        assertNotNull(binding);
View Full Code Here

    CompilationUnit cu = (CompilationUnit) parser.createAST(null);
//    List types = cu.structuralPropertiesForType();
    ASTRewrite rewriter = ASTRewrite.create(cu.getAST());
    for(Object o:cu.types()){
      AbstractTypeDeclaration dec = (AbstractTypeDeclaration) o;
      List bodyDeclarations = dec.bodyDeclarations();
      for(Object body:bodyDeclarations){
        MethodDeclaration methodDec = (MethodDeclaration) body;
        ListRewrite listRewrite = rewriter.getListRewrite(methodDec.getJavadoc(), Javadoc.TAGS_PROPERTY);
        List originalList = listRewrite.getOriginalList();
        ASTNode node = createNode(cu.getAST());
View Full Code Here

            AbstractTypeDeclaration typeNode = (AbstractTypeDeclaration) ((JavaElement) currentType).findNode(astCU);
            if (typeNode != null) {
              // rename type
              rewriter.replace(typeNode.getName(), ast.newSimpleName(newTypeName), null);
              // rename constructors
              Iterator bodyDeclarations = typeNode.bodyDeclarations().iterator();
              while (bodyDeclarations.hasNext()) {
                Object bodyDeclaration = bodyDeclarations.next();
                if (bodyDeclaration instanceof MethodDeclaration) {
                  MethodDeclaration methodDeclaration = (MethodDeclaration) bodyDeclaration;
                  if (methodDeclaration.isConstructor()) {
View Full Code Here

        }
        return true;
      }

      public boolean visit(TypeDeclaration typeDeclaration) {
        List bodyDeclarations = typeDeclaration.bodyDeclarations();
        for (Iterator iter = bodyDeclarations.iterator(); iter.hasNext();) {
          BodyDeclaration bodyDeclaration = (BodyDeclaration) iter.next();
          bodyDeclaration.setProperty(CompilationUnitSorter.RELATIVE_ORDER, new Integer(bodyDeclaration.getStartPosition()));
          typeDeclaration.setProperty(CONTAINS_MALFORMED_NODES, Boolean.valueOf(isMalformed(bodyDeclaration)));
        }
View Full Code Here

      public boolean visit(TypeDeclaration typeDeclaration) {
        if (checkMalformedNodes(typeDeclaration)) {
          return true; // abort sorting of current element
        }

        sortElements(typeDeclaration.bodyDeclarations(), rewriter.getListRewrite(typeDeclaration, TypeDeclaration.BODY_DECLARATIONS_PROPERTY));
        return true;
      }

      public boolean visit(EnumDeclaration enumDeclaration) {
        if (checkMalformedNodes(enumDeclaration)) {
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.