コード例 #1
0
 /*
  * @see ASTVisitor#visit(VariableDeclarationExpression)
  */
 public boolean visit(VariableDeclarationExpression node) {
   if (node.getAST().apiLevel() >= AST.JLS3) {
     printModifiers(node.modifiers());
   }
   node.getType().accept(this);
   this.fBuffer.append(" "); // $NON-NLS-1$
   for (Iterator it = node.fragments().iterator(); it.hasNext(); ) {
     VariableDeclarationFragment f = (VariableDeclarationFragment) it.next();
     f.accept(this);
     if (it.hasNext()) {
       this.fBuffer.append(", "); // $NON-NLS-1$
     }
   }
   return false;
 }
コード例 #2
0
 /*
  * @see ASTVisitor#visit(VariableDeclarationStatement)
  */
 @Override
 public boolean visit(VariableDeclarationStatement node) {
   if (node.getAST().apiLevel() >= JLS3) {
     printModifiers(node.modifiers());
   }
   node.getType().accept(this);
   this.fBuffer.append(" "); // $NON-NLS-1$
   for (Iterator<VariableDeclarationFragment> it = node.fragments().iterator(); it.hasNext(); ) {
     VariableDeclarationFragment f = it.next();
     f.accept(this);
     if (it.hasNext()) {
       this.fBuffer.append(", "); // $NON-NLS-1$
     }
   }
   this.fBuffer.append(";"); // $NON-NLS-1$
   return false;
 }