Interface AnnotationAJ

All Known Implementing Classes:
AbstractAnnotationAJ, StandardAnnotation

public interface AnnotationAJ
Simple representation of an annotation that the weaver can work with.
Author:
AndyClement
  • Field Details

  • Method Details

    • getTypeSignature

      String getTypeSignature()
      Returns:
      the signature for the annotation type, eg. Lcom/foo/MyAnno;
    • getTypeName

      String getTypeName()
      Returns:
      the type name for the annotation, eg. com.foo.MyAnno
    • getType

      ResolvedType getType()
      Returns:
      the type of the annotation
    • allowedOnAnnotationType

      boolean allowedOnAnnotationType()
      return true if this annotation can target an annotation type
    • allowedOnField

      boolean allowedOnField()
      Returns:
      true if this annotation can be put on a field
    • allowedOnRegularType

      boolean allowedOnRegularType()
      Returns:
      true if this annotation can target a 'regular' type. A 'regular' type is enum/class/interface - it is *not* annotation.
    • getTargets

      Set<String> getTargets()
      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.
    • hasNamedValue

      boolean hasNamedValue(String name)
      Parameters:
      name - the name of the value
      Returns:
      true if there is a value with that name
    • hasNameValuePair

      boolean hasNameValuePair(String name, String value)
      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
    • getValidTargets

      String getValidTargets()
      Returns:
      String representation of the valid targets for this annotation, eg. "{TYPE,FIELD}"
    • stringify

      String stringify()
      Returns:
      String form of the annotation and any values, eg. @Foo(a=b,c=d)
    • specifiesTarget

      boolean specifiesTarget()
      Returns:
      true if this annotation is marked with @target
    • isRuntimeVisible

      boolean isRuntimeVisible()
      Returns:
      true if the annotation is marked for runtime visibility
    • getStringFormOfValue

      String getStringFormOfValue(String name)
      Determine the string representation of the value of a field. For example in @SuppressAjWarnings({"adviceDidNotMatch"}) the return value for getStringFormOfValue("value") would be "[adviceDidNotMatch]".
      Parameters:
      name - the name of the annotation field being looked up
      Returns:
      string representation of the value of that field, may be null if no such field set