Class Annotation

java.lang.Object
proguard.util.SimpleProcessable
proguard.classfile.attribute.annotation.Annotation
All Implemented Interfaces:
Serializable, Processable
Direct Known Subclasses:
TypeAnnotation

public class Annotation extends SimpleProcessable
Representation of an annotation.
See Also:
  • Field Details

    • u2typeIndex

      public int u2typeIndex
    • u2elementValuesCount

      public int u2elementValuesCount
    • elementValues

      public ElementValue[] elementValues
    • referencedClasses

      public Clazz[] referencedClasses
      An extra field pointing to the Clazz objects referenced in the type string. This field is typically filled out by the ClassReferenceInitializer. References to primitive types are ignored.
  • Constructor Details

    • Annotation

      public Annotation()
      Creates an uninitialized Annotation.
    • Annotation

      public Annotation(int u2typeIndex, int u2elementValuesCount, ElementValue[] elementValues)
      Creates an initialized Annotation.
  • Method Details

    • getType

      public String getType(Clazz clazz)
      Returns the type.
    • referencedClassAccept

      public void referencedClassAccept(ClassVisitor classVisitor)
      Applies the given visitor to the first referenced class. This is the main annotation class.
    • referencedClassesAccept

      public void referencedClassesAccept(ClassVisitor classVisitor)
      Applies the given visitor to all referenced classes.
    • elementValueAccept

      public void elementValueAccept(Clazz clazz, int index, ElementValueVisitor elementValueVisitor)
      Applies the given visitor to the specified element value pair.
    • elementValuesAccept

      public void elementValuesAccept(Clazz clazz, ElementValueVisitor elementValueVisitor)
      Applies the given visitor to all element value pairs.