Examples of ASTVisitor


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

    this.toClass = toClass;
    this.fromMethod = fromMethod;
  }

  public void modify(Block block) {
    block.accept(new ASTVisitor() {

      @SuppressWarnings("unchecked")
      @Override
      public boolean visit(MethodInvocation node) {
          IMethod invokedMethod = (IMethod) node.resolveMethodBinding().getJavaElement();
View Full Code Here

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

  private Block parseCode(String code) {
    return JDTUtils.parseBlock(code);
  }

  public void modify(Block block) {
    block.accept(new ASTVisitor() {

      @SuppressWarnings("unchecked")
      @Override
      public boolean visit(MethodInvocation node) {
          IMethod invokedMethod = (IMethod) node.resolveMethodBinding().getJavaElement();
View Full Code Here

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

    final MethodCall methodCall = new MethodCall();
    methodCall.setClassName(methodDeclaration.resolveBinding().getDeclaringClass().getQualifiedName());
    methodCall.setMethodName(methodDeclaration.getName().toString());
    methodCall.setCompilationUnit(getCompilationUnit(methodDeclaration).getElementName());
   
    methodDeclaration.accept(new ASTVisitor() {

      @Override
      public boolean visit(MethodInvocation node) {
        ITypeBinding declaringClass = node.resolveMethodBinding().getDeclaringClass();
       
View Full Code Here

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

        .getAtgAstManager()
        .getAtgAst()
        .getRoot()
        .accept(renameTokenAtgVisitor);
     
      ASTVisitor renameTokenJavaVisitor = new ASTVisitor() {
        @Override
        public boolean visit(SimpleName node) {
         
          if (node.resolveBinding() != null &&
            node.resolveBinding().getKind() == IBinding.METHOD &&
View Full Code Here

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

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

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

  }

  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

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

      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

Examples of org.eclipse.jdt.internal.compiler.ASTVisitor

  public static Map<AbstractMethodDeclaration, JsniMethod> collectJsniMethods(
      final CompilationUnitDeclaration cud, final String source,
      final JsProgram program) {
    final Map<AbstractMethodDeclaration, JsniMethod> jsniMethods = new IdentityHashMap<AbstractMethodDeclaration, JsniMethod>();
    cud.traverse(new ASTVisitor() {
      @Override
      public void endVisit(TypeDeclaration type, BlockScope scope) {
        collectJsniMethods(cud, type, source, program, jsniMethods);
      }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.ASTVisitor

    if (!this.options.performMethodsFullRecovery && !this.options.performStatementsRecovery) {
      return null;
    }
    // collect all body declaration inside the compilation unit except the default constructor
    final List bodyDeclarations = new ArrayList();
    ASTVisitor visitor = new ASTVisitor() {
      public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
        if (!methodDeclaration.isDefaultConstructor()) {
          bodyDeclarations.add(methodDeclaration);
        }
        return false;
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.