Interface Annotatable

All Known Implementing Classes:
ClassFile, ClassFile.FieldInfo, ClassFile.MethodInfo

public interface Annotatable
An object in a Java class file which can have annotations (classes, methods and fields).
  • Method Details

    • getAnnotations

      ClassFile.Annotation[] getAnnotations(boolean runtimeVisible)
      Returns:
      The annotations on this element; an empty array iff there are no annotations
    • addAnnotationsAttributeEntry

      void addAnnotationsAttributeEntry(boolean runtimeVisible, String fieldDescriptor, Map<Short,ClassFile.ElementValue> elementValuePairs)
      Adds a "Runtime[In]visibleAnnotations" attribute to this object (if that annotation does not yet exist) and adds an entry to it.
      Parameters:
      elementValuePairs - Maps "elemant_name_index" (ClassFile.ConstantUtf8Info) to "element_value", see JVMS8 4.7.16