Examples of bodyDeclarations()


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

    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

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.AnonymousClassDeclaration.bodyDeclarations()

 
  protected boolean parse(WidgetAdapter adapter, EventSetDescriptor esd, MethodDescriptor mListener, ClassInstanceCreation instanceExpression) {
    AnonymousClassDeclaration acd = instanceExpression.getAnonymousClassDeclaration();
    anonymousClass = acd;
    List bodys = acd.bodyDeclarations();
    for (Object element : bodys) {
      if (element instanceof MethodDeclaration) {
        if (processListenerMethod(adapter, esd, mListener, (MethodDeclaration) element)) {
          return true;
        }
View Full Code Here

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

  }

 
  protected boolean parse(WidgetAdapter adapter, EventSetDescriptor esd, MethodDescriptor mListener, ClassInstanceCreation instanceExpression) {
    AnonymousClassDeclaration acd = instanceExpression.getAnonymousClassDeclaration();
    List bodys = acd.bodyDeclarations();
    Method[] lMethods = esd.getListenerMethods();
    for (Object element : bodys) {
      if (!(element instanceof MethodDeclaration)) {
        return false;
      }
View Full Code Here

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

            ClassInstanceCreation classLoaderCreation) {
        AST ast = rewrite.getAST();

        AnonymousClassDeclaration anonymousClassDeclaration = ast.newAnonymousClassDeclaration();
        MethodDeclaration runMethodDeclaration = createRunMethodDeclaration(rewrite, classLoaderCreation);
        List<BodyDeclaration> bodyDeclarations = checkedList(anonymousClassDeclaration.bodyDeclarations());

        bodyDeclarations.add(runMethodDeclaration);

        return anonymousClassDeclaration;
    }
View Full Code Here

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

        .getAnonymousClassDeclaration();
    if (anonymousClassDeclaration != null) {
      if (!rightTypeFound() && isRightType(node)) {
        setRightTypeFound(true);

        fSource = buildRunMethod(anonymousClassDeclaration
            .bodyDeclarations());
        fEvaluateNextEndTypeDeclaration = true;
      }

      if (rightTypeFound()) {
View Full Code Here

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

        fEvaluateNextEndTypeDeclaration = true;
      }

      if (rightTypeFound()) {

        List<BodyDeclaration> bodyDeclarations = anonymousClassDeclaration
            .bodyDeclarations();

        StringBuffer source = buildTypeBody(fSource, bodyDeclarations);

        ASTNode parent = node.getParent();
View Full Code Here

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

    when(typeCount.getName()).thenReturn("Integer");
    when(typeCount.getQualifiedName()).thenReturn("Integer");

    enumGenerator.generateContructorParameters(clazz, ast, md);

    ed.bodyDeclarations().add(md);

    assertEquals(
        "public enum Company {; private Company(String name,Integer count);\n}\n",
        cu.toString());
  }
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.