コード例 #1
0
 /*
  * @see ASTVisitor#visit(ConstructorInvocation)
  */
 public boolean visit(ConstructorInvocation node) {
   if (node.getAST().apiLevel() >= AST.JLS3) {
     if (!node.typeArguments().isEmpty()) {
       this.fBuffer.append("<"); // $NON-NLS-1$
       for (Iterator it = node.typeArguments().iterator(); it.hasNext(); ) {
         Type t = (Type) it.next();
         t.accept(this);
         if (it.hasNext()) {
           this.fBuffer.append(","); // $NON-NLS-1$
         }
       }
       this.fBuffer.append(">"); // $NON-NLS-1$
     }
   }
   this.fBuffer.append("this("); // $NON-NLS-1$
   for (Iterator it = node.arguments().iterator(); it.hasNext(); ) {
     Expression e = (Expression) it.next();
     e.accept(this);
     if (it.hasNext()) {
       this.fBuffer.append(","); // $NON-NLS-1$
     }
   }
   this.fBuffer.append(");"); // $NON-NLS-1$
   return false;
 }
 public boolean visit(ConstructorInvocation node) {
   if (matches(node.resolveConstructorBinding())) {
     // mark this
     SimpleName name = fAST.newSimpleName("xxxx"); // $NON-NLS-1$
     name.setSourceRange(node.getStartPosition(), 4);
     fResult.add(name);
   }
   return super.visit(node);
 }