Пример #1
0
 @Override
 public boolean visit(FieldDeclaration node) {
   String typName = node.getType().toString();
   List<VariableDeclarationFragment> vars = node.fragments();
   for (VariableDeclarationFragment var : vars) {
     map.put(var.getName().getIdentifier(), typName);
   }
   return true;
 }
Пример #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()) {}
    }
  }
 /*
  * @see ASTVisitor#visit(FieldDeclaration)
  */
 @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;
 }
Пример #4
0
 static void changeTypeContext(ResolutionContext old, ResolutionContext new_, FieldDeclaration f) {
   f.setType(changeTypeContext(old, new_, f.getType()));
 }
Пример #5
0
 @Override
 public void setType(Type type) {
   declaration.setType(SourceInfo.this.setType(type, declaration.getType()));
 }
Пример #6
0
 @Override
 public Type getType() {
   return getContext().resolve(declaration.getType());
 }