public boolean visit(FieldDeclaration declaration) throws Exception {
   // This is constant declaration:
   ISourceElementRequestor.FieldInfo info = new ISourceElementRequestor.FieldInfo();
   info.modifiers = Modifiers.AccConstant | Modifiers.AccPublic | Modifiers.AccFinal;
   info.name = declaration.getName();
   info.nameSourceStart = declaration.getNameStart();
   info.nameSourceEnd = declaration.getNameEnd() - 1;
   info.declarationStart = declaration.sourceStart();
   fRequestor.enterField(info);
   fRequestor.exitField(declaration.sourceEnd() - 1);
   return true;
 }
Ejemplo n.º 2
0
  public boolean visit(FieldDeclaration decl) throws Exception {
    // This is constant declaration:
    int modifiers = decl.getModifiers();
    modifiers = markAsDeprecated(modifiers, decl);

    modifyDeclaration(
        decl,
        new DeclarationInfo(
            IModelElement.FIELD,
            modifiers,
            decl.sourceStart(),
            decl.sourceEnd() - decl.sourceStart(),
            decl.getNameStart(),
            decl.getNameEnd() - decl.getNameStart(),
            decl.getName(),
            null,
            encodeDocInfo(decl),
            null,
            null));

    return visitGeneral(decl);
  }