Ejemplo n.º 1
0
 FieldDeclarationWrapper(FieldDeclaration declaration) {
   this.declaration = declaration;
   if (declaration.getVariables().size() != 1) {
     throw new UnsupportedOperationException(
         "Not yet implemented: multiple variables in one field decl.");
   }
 }
Ejemplo n.º 2
0
  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()) {}
    }
  }
Ejemplo n.º 3
0
 @Override
 public void setName(String name) {
   declaration.getVariables().get(0).getId().setName(name);
 }
Ejemplo n.º 4
0
 @Override
 public String getName() {
   return declaration.getVariables().get(0).getId().getName();
 }