Package org.eclipse.jdt.core.dom

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


  private void goThroughClass(String ClassContent) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent.toCharArray());
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      private String elNodeName;
      private boolean intoEL;

      public void endVisit(FieldDeclaration node) {
View Full Code Here


  private void goThroughClass(String ClassContent) {
    ASTParser parser = ASTParser.newParser(AST.JLS3);
    parser.setSource(ClassContent.toCharArray());
    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    final CompilationUnit cu = (CompilationUnit) parser.createAST(null);
    cu.accept(new ASTVisitor() {

      private String elNodeName;
      private boolean intoEL;
      private boolean definedId;
View Full Code Here

    parser.setKind(ASTParser.K_COMPILATION_UNIT);
    parser.setSource(iUnit);
    parser.setResolveBindings(true);
    Visitor visitor = new Visitor();
    CompilationUnit unit = (CompilationUnit) parser.createAST(null);
    unit.accept(visitor);
    return unit; // parse
  }

  /**
   * return all CompilationUnits AST nodes in the given package
View Full Code Here

    for(IPackageFragment packageFragment : packageFragments){
      ICompilationUnit [] iUnits = packageFragment.getCompilationUnits();     
      for(ICompilationUnit iUnit : iUnits){
        CompilationUnit unit = Visitor.parse(iUnit);
        Visitor cVisitor = new Visitor();
        unit.accept(cVisitor);
        expectedTypeList.addAll(cVisitor.getClasses());
      }
    }
    List<TypeDeclaration> actualTypeList = JdtManipulator
        .getTypeDeclarations(javaProject);
View Full Code Here

    List <TypeDeclaration> expectedTypeList = new ArrayList<TypeDeclaration>();
    ICompilationUnit [] iUnits = packageFragment.getCompilationUnits();     
    for(ICompilationUnit iUnit : iUnits){
      CompilationUnit unit = Visitor.parse(iUnit);
      Visitor cVisitor = new Visitor();
      unit.accept(cVisitor);
      expectedTypeList.addAll(cVisitor.getClasses());
    }
   
    List<TypeDeclaration> actualTypeList = JdtManipulator
        .getTypeDeclarations(packageFragment);
View Full Code Here

    List <MethodDeclaration> expectedMethodList = new ArrayList<MethodDeclaration>();
    ICompilationUnit [] iUnits = packageFragment.getCompilationUnits();     
    for(ICompilationUnit iUnit : iUnits){
      CompilationUnit unit = Visitor.parse(iUnit);
      Visitor visitor = new Visitor();
      unit.accept(visitor);
      List <TypeDeclaration> typeList = new ArrayList<TypeDeclaration>(visitor.getClasses());
      for(TypeDeclaration typeDeclaration: typeList){
        expectedMethodList.addAll(Arrays.asList(typeDeclaration.getMethods()));
      }
    }
View Full Code Here

        final CompilationUnit ast = createAST(javaProject, className);

        if (ast == null)
            return null;

        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(TypeDeclaration typeDecl) {
                ITypeBinding typeBinding = typeDecl.resolveBinding();
                if (typeBinding != null) {
                    if (typeBinding.getBinaryName().equals(className)) {
View Full Code Here

        final CompilationUnit ast = createAST(javaProject, className);

        if (ast == null)
            return null;

        ast.accept(new ASTVisitor() {
            @Override
            public boolean visit(MethodDeclaration methodDecl) {
                if (matches(ast, methodDecl, methodName, methodSignature)) {
                    // Create the marker attribs here
                    markerAttributes.put(IMarker.CHAR_START, methodDecl.getStartPosition());
View Full Code Here

        cls.setPlugin(plugin);
        cls.setPackage(pkg);
        cls.setName(name);
        cls.setParent(root);
       
        cu.accept(new OperationalSemanticsJavadocVisitor(factory, root, cls, input));
      }
    }
   
  }
View Full Code Here

          for (IPackageFragment mypackage : packages){
            if (mypackage.getKind() == IPackageFragmentRoot.K_SOURCE){
              for (ICompilationUnit unit : mypackage.getCompilationUnits()){
                CompilationUnit parse = parse(unit);
                ClassAndPropertyVisitor visitor = new ClassAndPropertyVisitor();
                parse.accept(visitor);
               
              }
            }
          }
        }
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.