Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ASTNode.accept()


        _output("/** ");
        _output(_indent);

        for (Iterator it = node.tags().iterator(); it.hasNext();) {
            ASTNode e = (ASTNode) it.next();
            e.accept(this);
        }

        _output("\n");
        _output(_indent);
        _output(" */\n");
 
View Full Code Here


            // add space if required to separate
            if (previousRequiresWhiteSpace && !currentIncludesWhiteSpace) {
                _output(" ");
            }

            e.accept(this);
            previousRequiresWhiteSpace = !currentIncludesWhiteSpace
                    && !(e instanceof TagElement);
        }

        if (node.isNested()) {
View Full Code Here

     * (element type: <code>IExtendedModifiers</code>)
     */
    private void _outputModifiers(List ext) {
        for (Iterator it = ext.iterator(); it.hasNext();) {
            ASTNode p = (ASTNode) it.next();
            p.accept(this);
            _output(" ");
        }
    }

    ///////////////////////////////////////////////////////////////////
View Full Code Here

          IJavaElement elem = (IJavaElement) match.getElement();
          ASTNode node = Util.getASTNode(elem,
              ASTNodeProcessor.this.monitor);
          ParameterProcessingVisitor visitor = new ParameterProcessingVisitor(
              paramNumber, match.getOffset());
          node.accept(visitor);
          ASTNodeProcessor.this.found.addAll(visitor.getElements());

          for (Iterator it = visitor.getExpressions().iterator(); it
              .hasNext();) {
            Expression exp = (Expression) it.next();
View Full Code Here

//      }
//    }

    // catch all errors
    try {
      lResult.accept(this);
    } catch (Exception ex) {
      //TODO Exception handling
    }
    return status;
  }
View Full Code Here

        ASTNode specificNode = NodeFinder.perform(lResult, start, end-start);
        if (specificNode.getStartPosition() != start || specificNode.getLength() != (end-start)) {
            System.out.println("Could not find the corresponding AST node at position: " + start);
        }
        try {
            specificNode.accept(mcbVisitor);
        } catch (Exception ex) {
            //TODO Error handling
        }

        return mcbVisitor.getMetricValue();
View Full Code Here

        }
        System.out.println(node.fragments().size());
        return super.visit(node);
      }
    };
    node.accept(visitor);
    assertEquals(expected,actual);
    actual.clear();
    source =
    "/**\n" +
    " *  @see test.TestClass\n" +
View Full Code Here

    "}\n";
    parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(source.toCharArray());
    parser.setKind(ASTParser.K_CLASS_BODY_DECLARATIONS);
    node = parser.createAST(null);
    node.accept(visitor);
    assertEquals(expected,actual);
  }

 
//  @Test
View Full Code Here

    createNewParser();
    if(source != null){
      parser.setSource(source.toCharArray());
    }
    ASTNode node = parser.createAST(null);
    node.accept(visitor);
  }
 
  @AfterClass
  public static void after() throws Exception{
    project.dispose();
View Full Code Here

        }
        System.out.println();
        return super.visit(node);
      }
    };
    node.accept(visitor);
    assertEquals(expected,actual);
    actual.clear();
    source =
    "/**\n" +
    " *  @see test.TestClass\n" +
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.