Klasse AnnotationTypeMemberDeclaration


public class AnnotationTypeMemberDeclaration extends BodyDeclaration
Annotation type member declaration AST node type (added in JLS3 API).
 AnnotationTypeMemberDeclaration:
   [ Javadoc ] { ExtendedModifier }
       Type Identifier ( ) [ default Expression ] ;
 

Note that annotation type member declarations are only meaningful as elements of AbstractTypeDeclaration.bodyDeclarations().

When a Javadoc comment is present, the source range begins with the first character of the "/**" comment delimiter. When there is no Javadoc comment, the source range begins with the first character of the first modifier keyword (if modifiers), or the first character of the member type (no modifiers). The source range extends through the last character of the ";" token.

Seit:
3.1
  • Felddetails

  • Methodendetails

    • propertyDescriptors

      public static List propertyDescriptors(int apiLevel)
      Returns a list of structural property descriptors for this node type. Clients must not modify the result.
      Parameter:
      apiLevel - the API level; one of the AST.JLS* constants
      Gibt zurück:
      a list of property descriptors (element type: StructuralPropertyDescriptor)
    • getType

      public Type getType()
      Returns the type of the annotation type member declared in this declaration.
      Gibt zurück:
      the type of the member
    • setType

      public void setType(Type type)
      Sets the type of the annotation type member declared in this declaration to the given type.
      Parameter:
      type - the new member type
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
    • getName

      public SimpleName getName()
      Returns the name of the annotation type member declared in this declaration.
      Gibt zurück:
      the member name node
    • setName

      public void setName(SimpleName memberName)
      Sets the name of the annotation type member declared in this declaration to the given name.
      Parameter:
      memberName - the new member name
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
    • getDefault

      public Expression getDefault()
      Returns the default value of this annotation type member, or null if there is none.
      Gibt zurück:
      the expression node, or null if there is none
    • setDefault

      public void setDefault(Expression defaultValue)
      Sets or clears the default value of this annotation type member.
      Parameter:
      defaultValue - the expression node, or null if there is none
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
      • a cycle in would be created
    • resolveBinding

      public IMethodBinding resolveBinding()
      Resolves and returns the binding for the annotation type member declared in this declaration.

      Note that bindings are generally unavailable unless requested when the AST is being built.

      Gibt zurück:
      the binding, or null if the binding cannot be resolved