Package org.codehaus.janino.util
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 Summary
Modifier and TypeMethodDescriptionvoid
addAnnotationsAttributeEntry
(boolean runtimeVisible, String fieldDescriptor, Map<Short, ClassFile.ElementValue> elementValuePairs) Adds a "Runtime[In]visibleAnnotations" attribute tothis
object (if that annotation does not yet exist) and adds an entry to it.getAnnotations
(boolean runtimeVisible)
-
Method Details
-
getAnnotations
- 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 tothis
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
-