Class AbstractAnnotationAJ

java.lang.Object
org.aspectj.weaver.AbstractAnnotationAJ
All Implemented Interfaces:
AnnotationAJ
Direct Known Subclasses:
BcelAnnotation, StandardAnnotation

public abstract class AbstractAnnotationAJ extends Object implements AnnotationAJ
  • Field Details

  • Constructor Details

    • AbstractAnnotationAJ

      public AbstractAnnotationAJ(ResolvedType type)
  • Method Details

    • getType

      public final ResolvedType getType()
      Specified by:
      getType in interface AnnotationAJ
      Returns:
      the type of the annotation
    • getTypeSignature

      public final String getTypeSignature()
      Specified by:
      getTypeSignature in interface AnnotationAJ
      Returns:
      the signature for the annotation type, eg. Lcom/foo/MyAnno;
    • getTypeName

      public final String getTypeName()
      Specified by:
      getTypeName in interface AnnotationAJ
      Returns:
      the type name for the annotation, eg. com.foo.MyAnno
    • allowedOnAnnotationType

      public final boolean allowedOnAnnotationType()
      return true if this annotation can target an annotation type
      Specified by:
      allowedOnAnnotationType in interface AnnotationAJ
    • allowedOnField

      public final boolean allowedOnField()
      Specified by:
      allowedOnField in interface AnnotationAJ
      Returns:
      true if this annotation can be put on a field
    • allowedOnRegularType

      public final boolean allowedOnRegularType()
      Specified by:
      allowedOnRegularType in interface AnnotationAJ
      Returns:
      true if this annotation can target a 'regular' type. A 'regular' type is enum/class/interface - it is *not* annotation.
    • ensureAtTargetInitialized

      public final void ensureAtTargetInitialized()
    • getValidTargets

      public final String getValidTargets()
      Specified by:
      getValidTargets in interface AnnotationAJ
      Returns:
      String representation of the valid targets for this annotation, eg. "{TYPE,FIELD}"
    • specifiesTarget

      public final boolean specifiesTarget()
      Specified by:
      specifiesTarget in interface AnnotationAJ
      Returns:
      true if this annotation is marked with @target
    • isRuntimeVisible

      public abstract boolean isRuntimeVisible()
      Specified by:
      isRuntimeVisible in interface AnnotationAJ
      Returns:
      true if the annotation is marked for runtime visibility
    • getTargets

      public abstract Set<String> getTargets()
      Specified by:
      getTargets in interface AnnotationAJ
      Returns:
      for the @target annotation, this will return a set of the element-types it can be applied to. For other annotations , it returns the empty set.
    • hasNameValuePair

      public abstract boolean hasNameValuePair(String name, String value)
      Specified by:
      hasNameValuePair in interface AnnotationAJ
      Parameters:
      name - the name of the annotation field
      value - the value of the annotation field
      Returns:
      true if there is a value with the specified name and value
    • hasNamedValue

      public abstract boolean hasNamedValue(String name)
      Specified by:
      hasNamedValue in interface AnnotationAJ
      Parameters:
      name - the name of the value
      Returns:
      true if there is a value with that name
    • stringify

      public abstract String stringify()
      Specified by:
      stringify in interface AnnotationAJ
      Returns:
      String form of the annotation and any values, eg. @Foo(a=b,c=d)