private void visitFragments(List fragments) { for (Iterator it = fragments.iterator(); it.hasNext(); ) { ((VariableDeclarationFragment) it.next()).accept(this); } }
/** * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.FieldDeclaration) */ public boolean visit(FieldDeclaration node) { if (containsPosition(node)) { // visit only the variable declaration fragments List fragments = node.fragments(); if (fragments.size() == 1) { fFieldName= ((VariableDeclarationFragment)fragments.get(0)).getName().getIdentifier(); fTypeName= ValidBreakpointLocationLocator.computeTypeName(node); fFound= true; return false; } for (Iterator iter = fragments.iterator(); iter.hasNext() && !fFound;) { ((VariableDeclarationFragment) iter.next()).accept(this); } } return false; }
@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; }
@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; }
@Override public boolean visit(VariableDeclarationExpression 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$ } } return false; }
@Override public boolean visit(VariableDeclarationExpression 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$ } } return false; }
@Override public boolean visit(FieldDeclaration node) { if (node.getJavadoc() != null) { node.getJavadoc().accept(this); } 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; }
public boolean visit(VariableDeclarationStatement node) { if (node.getAST().apiLevel() == AST.JLS2) { printModifiers(node.getModifiers()); } 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$ } } this.fBuffer.append(";");//$NON-NLS-1$ return false; }
public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } return false; }
public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == AST.JLS2) { printModifiers(node.getModifiers()); } 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; }
public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } return false; }
@Override public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } return false; }
public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } return false; }
public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= AST.JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } return false; }
public boolean visit(VariableDeclarationStatement node) { printIndent(); if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } this.buffer.append(";\n");//$NON-NLS-1$ return false; }
@Override public boolean visit(VariableDeclarationStatement node) { printIndent(); if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } this.buffer.append(";\n");//$NON-NLS-1$ return false; }
public boolean visit(VariableDeclarationExpression node) { if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } return false; }
public boolean visit(VariableDeclarationStatement node) { printIndent(); if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } this.buffer.append(";\n");//$NON-NLS-1$ return false; }
public boolean visit(VariableDeclarationStatement node) { printIndent(); if (node.getAST().apiLevel() == JLS2) { printModifiers(node.getModifiers()); } if (node.getAST().apiLevel() >= AST.JLS3) { printModifiers(node.modifiers()); } node.getType().accept(this); this.buffer.append(" ");//$NON-NLS-1$ for (Iterator it = node.fragments().iterator(); it.hasNext(); ) { VariableDeclarationFragment f = (VariableDeclarationFragment) it.next(); f.accept(this); if (it.hasNext()) { this.buffer.append(", ");//$NON-NLS-1$ } } this.buffer.append(";\n");//$NON-NLS-1$ return false; }
@Override public boolean visit(final VariableDeclarationExpression it) { final Procedure2<VariableDeclarationFragment, Integer> _function = (VariableDeclarationFragment frag, Integer counter) -> { this.appendModifiers(it, it.modifiers()); this.appendToBuffer(this._aSTFlattenerUtils.handleVariableDeclaration(it.modifiers())); this.appendSpaceToBuffer(); it.getType().accept(this); this.appendSpaceToBuffer(); frag.accept(this); int _size = it.fragments().size(); int _minus = (_size - 1); boolean _lessThan = ((counter).intValue() < _minus); if (_lessThan) { this.appendToBuffer(","); this.appendSpaceToBuffer(); } }; IterableExtensions.<VariableDeclarationFragment>forEach(it.fragments(), _function); return false; }