Package org.eclipse.jdt.core.dom

Examples of org.eclipse.jdt.core.dom.ASTVisitor


        .getRoot()
        .accept(renameTokenAtgVisitor);
     
      final String oldJavaName = "_" + info.getOldName();
      final String newJavaName = "_" + info.getNewName();
      ASTVisitor renameTokenJavaVisitor = new ASTVisitor() {
        @Override
        public boolean visit(SimpleName node) {
         
          if (node.resolveBinding() != null &&
            node.resolveBinding().getKind() == IBinding.VARIABLE &&
View Full Code Here


  }

  public static ASTNode getExactASTNode(CompilationUnit root,
      final SearchMatch match) {
    final ArrayList ret = new ArrayList(1);
    final ASTVisitor visitor = new ASTVisitor() {
      public void preVisit(ASTNode node) {
        if (node.getStartPosition() == match.getOffset()) {
          ret.clear();
          ret.add(node);
        }
View Full Code Here

      this.processExpression(ce);
      break;
    }

    case ASTNode.METHOD_DECLARATION: {
      final ASTVisitor visitor = new ASTVisitor() {
        public boolean visit(ReturnStatement node) {
          try {
            ASTNodeProcessor.this.processExpression(node
                .getExpression());
          } catch (JavaModelException E) {
View Full Code Here

          throws Exception {
        sourcePackages.add(new SourcePackageDescriptor(packageName, superSource));
      }
    });
    // validate all types in CompilationUnit
    astUnit.accept(new ASTVisitor() {
      private final Set<String> m_validClasses = Sets.newTreeSet();
      private final Set<String> m_invalidClasses = Sets.newTreeSet();

      @Override
      public boolean visit(SingleMemberAnnotation node) {
View Full Code Here

      ITypeBinding typeBinding) throws Exception {
    // check for GWT type
    {
      // check if there are com.google.gwt.user.client.ui.UIObject successors
      final boolean[] isGWT = new boolean[1];
      typeDeclaration.accept(new ASTVisitor() {
        @Override
        public void postVisit(ASTNode node) {
          if (!isGWT[0] && node instanceof Expression) {
            Expression expression = (Expression) node;
            ITypeBinding expressionBinding = AstNodeUtils.getTypeBinding(expression);
View Full Code Here

      final String newServletName) throws Exception {
    ICompilationUnit serviceCompilationUnit = serviceType.getCompilationUnit();
    // parse service type into AST and change servlet path
    CompilationUnit serviceUnit = CodeUtils.parseCompilationUnit(serviceCompilationUnit);
    serviceUnit.recordModifications();
    serviceUnit.accept(new ASTVisitor() {
      @Override
      public void endVisit(StringLiteral node) {
        if (oldServletName.equals(node.getLiteralValue())) {
          node.setLiteralValue(newServletName);
        }
View Full Code Here

      }

      final String oldName = this.name;
      final boolean visitDocTags = true;

      final ASTVisitor renameVisitor = new ASTVisitor(visitDocTags)
      {
         @Override
         public boolean visit(SimpleName node)
         {
            if (Strings.areEqual(oldName, node.getIdentifier()))
View Full Code Here

        assert rewrite != null;
        assert block != null;
        assert variables != null;

        final AST ast = rewrite.getAST();
        block.accept(new ASTVisitor() {

            @Override
            public boolean visit(VariableDeclarationFragment fragment) {
                if (variables.contains(fragment.getName().getFullyQualifiedName())) {
                    ASTNode parent = fragment.getParent();
View Full Code Here

    private Set<String> findVariableReferences(List<?> arguments) {
        final Set<String> refs = new HashSet<String>();
        for (Object argumentObj : arguments) {
            Expression argument = (Expression) argumentObj;
            argument.accept(new ASTVisitor() {

                @Override
                public boolean visit(SimpleName node) {
                    if (!(node.getParent() instanceof Type)) {
                        refs.add(node.getFullyQualifiedName());
View Full Code Here

  // IParseValidator
  //
  ////////////////////////////////////////////////////////////////////////////
  public void validate(final AstEditor editor) throws Exception {
    if (editor.getSource().contains("createAndBindUi")) {
      editor.getAstUnit().accept(new ASTVisitor() {
        @Override
        public void endVisit(MethodInvocation node) {
          if (isBindInvocation(node)) {
            String unitName = editor.getModelUnit().getElementName();
            throw new DesignerException(IExceptionConstants.DONT_OPEN_JAVA, unitName);
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.dom.ASTVisitor

Copyright © 2018 www.massapicom. 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.