Examples of bodyDeclarations()


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

        }
        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

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

      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

Examples of org.aspectj.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

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

      createdNodeSource = generateSyntaxIncorrectAST();
      if (this.createdNode == null)
        throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
    } else {
      TypeDeclaration typeDeclaration = (TypeDeclaration) node;
      this.createdNode = (ASTNode) typeDeclaration.bodyDeclarations().iterator().next();
      createdNodeSource = this.source;
    }
    if (this.alteredName != null) {
      SimpleName newName = this.createdNode.getAST().newSimpleName(this.alteredName);
      SimpleName oldName = rename(this.createdNode, newName);
View Full Code Here

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

  buff.append(lineSeparator).append('}');
  ASTParser parser = ASTParser.newParser(AST.JLS3);
  parser.setSource(buff.toString().toCharArray());
  CompilationUnit compilationUnit = (CompilationUnit) parser.createAST(null);
  TypeDeclaration typeDeclaration = (TypeDeclaration) compilationUnit.types().iterator().next();
  List bodyDeclarations = typeDeclaration.bodyDeclarations();
  if (bodyDeclarations.size() != 0)
    this.createdNode = (ASTNode) bodyDeclarations.iterator().next();
  return buff.toString();
}
/**
 
View Full Code Here

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

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

        }
        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

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

      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

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

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

    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
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.