All Implemented Interfaces:
TypeConstants, TypeIds
Direct Known Subclasses:
MarkerAnnotation, NormalAnnotation, SingleMemberAnnotation

public abstract class Annotation extends Expression
Annotation
  • Field Details

    • declarationSourceEnd

      public int declarationSourceEnd
    • recipient

      public Binding recipient
    • type

      public TypeReference type
    • compilerAnnotation

      protected AnnotationBinding compilerAnnotation
      The representation of this annotation in the type system.
  • Constructor Details

    • Annotation

      public Annotation()
  • Method Details

    • getLocations

      public static int[] getLocations​(Expression reference, Annotation annotation)
      Return the location for the corresponding annotation inside the type reference, null if none.
    • getRetentionPolicy

      public static long getRetentionPolicy​(char[] policyName)
    • getTargetElementType

      public static long getTargetElementType​(char[] elementName)
    • computeElementValuePairs

      public ElementValuePair[] computeElementValuePairs()
    • nullLocationBitsFromAnnotationValue

      public static int nullLocationBitsFromAnnotationValue​(Object value)
      Convert the value() attribute of @NonNullByDefault into a bitvector a la Binding.NullnessDefaultMASK. This method understands value encodings from source and binary types. pre: null annotation analysis is enabled
    • nullLocationBitsFromElementTypeAnnotationValue

      public static int nullLocationBitsFromElementTypeAnnotationValue​(Object value)
    • checkRepeatableMetaAnnotation

      public void checkRepeatableMetaAnnotation​(BlockScope scope)
    • checkContainerAnnotationType

      public static void checkContainerAnnotationType​(ASTNode culpritNode, BlockScope scope, ReferenceBinding containerAnnotationType, ReferenceBinding repeatableAnnotationType, boolean useSite)
    • checkContainingAnnotationTargetAtUse

      public static void checkContainingAnnotationTargetAtUse​(Annotation repeatingAnnotation, BlockScope scope, TypeBinding containerAnnotationType, TypeBinding repeatingAnnotationType)
    • getCompilerAnnotation

      public AnnotationBinding getCompilerAnnotation()
    • isRuntimeInvisible

      public boolean isRuntimeInvisible()
    • isRuntimeTypeInvisible

      public boolean isRuntimeTypeInvisible()
    • isRuntimeTypeVisible

      public boolean isRuntimeTypeVisible()
    • isRuntimeVisible

      public boolean isRuntimeVisible()
    • memberValuePairs

      public abstract MemberValuePair[] memberValuePairs()
    • printExpression

      public StringBuffer printExpression​(int indent, StringBuffer output)
      Specified by:
      printExpression in class Expression
    • recordSuppressWarnings

      public void recordSuppressWarnings​(Scope scope, int startSuppresss, int endSuppress, boolean isSuppressingWarnings)
    • resolveType

      public TypeBinding resolveType​(BlockScope scope)
      Description copied from class: Expression
      Resolve the type of this expression in the context of a blockScope
      Overrides:
      resolveType in class Expression
      Returns:
      Return the actual type of this expression after resolution
    • handleNonNullByDefault

      public long handleNonNullByDefault​(BlockScope scope)
    • isAnnotationTargetAllowed

      public static boolean isAnnotationTargetAllowed​(BlockScope scope, TypeBinding annotationType, Binding recipient)
    • checkForInstancesOfRepeatableWithRepeatingContainerAnnotation

      public static void checkForInstancesOfRepeatableWithRepeatingContainerAnnotation​(BlockScope scope, ReferenceBinding repeatedAnnotationType, Annotation[] sourceAnnotations)
      Check to see if a repeating annotation is in fact of a container annotation type for an annotation which is also present at the same target.
      Parameters:
      scope - The scope (for error reporting)
      repeatedAnnotationType - Type of annotation which has been repeated (to check for possibly being a container for a repeatable annotation)
      sourceAnnotations - The annotations to check
    • isTypeUseCompatible

      public static boolean isTypeUseCompatible​(TypeReference reference, Scope scope)
    • isTypeUseCompatible

      public static void isTypeUseCompatible​(TypeReference reference, Scope scope, Annotation[] annotations)
    • hasNullBit

      public boolean hasNullBit​(int bit)
    • traverse

      public abstract void traverse​(ASTVisitor visitor, BlockScope scope)
      Description copied from class: Expression
      Traverse an expression in the context of a blockScope
      Overrides:
      traverse in class Expression
    • traverse

      public abstract void traverse​(ASTVisitor visitor, ClassScope scope)
      Description copied from class: Expression
      Traverse an expression in the context of a classScope
      Overrides:
      traverse in class Expression
    • getPersistibleAnnotation

      public Annotation getPersistibleAnnotation()
    • setPersistibleAnnotation

      public void setPersistibleAnnotation​(ContainerAnnotation container)