FieldDeclarationWrapper(FieldDeclaration declaration) { this.declaration = declaration; if (declaration.getVariables().size() != 1) { throw new UnsupportedOperationException( "Not yet implemented: multiple variables in one field decl."); } }
public void visit(FieldDeclaration n, Object arg) { if (n.getJavaDoc() != null) { n.getJavaDoc().accept(this, arg); } printMemberAnnotations(n.getAnnotations(), arg); printModifiers(n.getModifiers()); n.getType().accept(this, arg); for (Iterator<VariableDeclarator> i = n.getVariables().iterator(); i.hasNext(); ) { VariableDeclarator var = i.next(); var.accept(this, arg); if (i.hasNext()) {} } }
@Override public void setName(String name) { declaration.getVariables().get(0).getId().setName(name); }
@Override public String getName() { return declaration.getVariables().get(0).getId().getName(); }