Klasse Annotation

Alle implementierten Schnittstellen:
IExtendedModifier
Bekannte direkte Unterklassen:
MarkerAnnotation, NormalAnnotation, SingleMemberAnnotation

public abstract class Annotation extends Expression implements IExtendedModifier
Abstract base class of AST nodes that represent annotations.
 Annotation:
                NormalAnnotation
                MarkerAnnotation
                SingleMemberAnnotation
 
Seit:
3.1
  • Methodendetails

    • getTypeNameProperty

      public final ChildPropertyDescriptor getTypeNameProperty()
      Returns structural property descriptor for the "typeName" property of this node (child type: Name).
      Gibt zurück:
      the property descriptor
    • isModifier

      public boolean isModifier()
      Beschreibung aus Schnittstelle kopiert: IExtendedModifier
      Returns whether this extended modifier is a standard modifier.
      Angegeben von:
      isModifier in Schnittstelle IExtendedModifier
      Gibt zurück:
      true if this is a standard modifier (instance of Modifier), and false otherwise
      Siehe auch:
    • isAnnotation

      public boolean isAnnotation()
      Beschreibung aus Schnittstelle kopiert: IExtendedModifier
      Returns whether this extended modifier is an annotation.
      Angegeben von:
      isAnnotation in Schnittstelle IExtendedModifier
      Gibt zurück:
      true if this is an annotation (instance of a subclass of Annotation), and false otherwise
      Siehe auch:
    • getTypeName

      public Name getTypeName()
      Returns the annotation type name of this annotation.
      Gibt zurück:
      the annotation type name
    • setTypeName

      public void setTypeName(Name typeName)
      Sets the annotation type name of this annotation.
      Parameter:
      typeName - the annotation type name
      Löst aus:
      IllegalArgumentException - if:
      • the node belongs to a different AST
      • the node already has a parent
    • isNormalAnnotation

      public boolean isNormalAnnotation()
      Returns whether this is a normal annotation (NormalAnnotation).
      Gibt zurück:
      true if this is a normal annotation, and false otherwise
    • isMarkerAnnotation

      public boolean isMarkerAnnotation()
      Returns whether this is a marker annotation (MarkerAnnotation).
      Gibt zurück:
      true if this is a marker annotation, and false otherwise
    • isSingleMemberAnnotation

      public boolean isSingleMemberAnnotation()
      Returns whether this is a single member annotation. (SingleMemberAnnotation).
      Gibt zurück:
      true if this is a single member annotation, and false otherwise
    • resolveAnnotationBinding

      public IAnnotationBinding resolveAnnotationBinding()
      Resolves and returns the resolved annotation for this annotation.

      Note that bindings (which includes resolved annotations) are generally unavailable unless requested when the AST is being built.

      Gibt zurück:
      the resolved annotation, or null if the annotation cannot be resolved
      Seit:
      3.2