Examples of bodyDeclarations()


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

      if ((typeDeclaration.getFlags() & ASTNode.MALFORMED) != 0) {
        createdNodeSource = generateSyntaxIncorrectAST();
        if (this.createdNode == null)
          throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
      } else {
        List bodyDeclarations = typeDeclaration.bodyDeclarations();
        if (bodyDeclarations.size() == 0) {
          throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INVALID_CONTENTS));
        }
        this.createdNode = (ASTNode) bodyDeclarations.iterator().next();
        createdNodeSource = this.source;
View Full Code Here

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

  buff.append(lineSeparator).append('}');
  ASTParser parser = ASTParser.newParser(AST.JLS4);
  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.TypeDeclaration.bodyDeclarations()

    }

    // atributos
    List<FieldDeclaration> fields = getClassFields(classFields, classId);
    for (FieldDeclaration fieldDeclaration : fields) {
      result.bodyDeclarations().add(fieldDeclaration);
    }

    // methods
    List<MethodDeclaration> methods = getClassMethods(classFields, classId);
    for (MethodDeclaration methodDeclaration : methods) {
View Full Code Here

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

    }

    // methods
    List<MethodDeclaration> methods = getClassMethods(classFields, classId);
    for (MethodDeclaration methodDeclaration : methods) {
      result.bodyDeclarations().add(methodDeclaration);
    }

    return result;
  }
View Full Code Here

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

    if (methodDecl.isConstructor()) {
      // @Autowired can only be applied to one constructor per class
      // make sure no other constructors are already annotated
      TypeDeclaration typeDecl = getEnclosingTypeDeclaration(methodDecl);
      if (typeDecl != null) {
        List<BodyDeclaration> decls = typeDecl.bodyDeclarations();
        for (BodyDeclaration decl : decls) {
          if (decl instanceof MethodDeclaration) {
            MethodDeclaration currentMethodDecl = (MethodDeclaration) decl;
            if (currentMethodDecl.isConstructor() && currentMethodDecl != methodDecl) {
              if (ProposalCalculatorUtil.hasAnnotation(getAnnotationName(), currentMethodDecl)) {
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.