public class RuntimeAnnotationsAttr extends Attribute
Constructor and Description |
---|
RuntimeAnnotationsAttr(java.lang.String name,
AnnotationEntry[] entries,
int numEntries,
AttrContainer container)
Add a new AnnotationAttr to a Member.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationEntry ann)
Add an annotation to this attribute.
|
void |
assignConstants(ClassType cl)
Add any needed constant pool entries for this Attribute.
|
static <T extends java.lang.annotation.Annotation> |
getAnnotation(AttrContainer container,
java.lang.Class<T> clas) |
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> clas) |
static RuntimeAnnotationsAttr |
getAnnotationsAttr(AttrContainer container,
java.lang.String name) |
int |
getLength()
Return the length of the attribute in bytes.
|
static RuntimeAnnotationsAttr |
getRuntimeInvisibleAnnotations(AttrContainer container)
Get or create a RuntimeInvisibleAnnotations attribute.
|
static RuntimeAnnotationsAttr |
getRuntimeVisibleAnnotations(AttrContainer container)
Get or create a RuntimeVisibleAnnotations attribute.
|
static void |
maybeAddAnnotation(AttrContainer container,
AnnotationEntry annotation)
Add to appropriate annotations attribute.
|
void |
print(ClassTypeWriter dst) |
void |
write(java.io.DataOutputStream dstr)
Write out the contents of the Attribute.
|
addToFrontOf, assignConstants, count, get, getConstants, getContainer, getLengthAll, getName, getNameIndex, getNext, isSkipped, setContainer, setName, setNameIndex, setNext, setSkipped, setSkipped, writeAll
public RuntimeAnnotationsAttr(java.lang.String name, AnnotationEntry[] entries, int numEntries, AttrContainer container)
public static RuntimeAnnotationsAttr getAnnotationsAttr(AttrContainer container, java.lang.String name)
public static RuntimeAnnotationsAttr getRuntimeVisibleAnnotations(AttrContainer container)
public static RuntimeAnnotationsAttr getRuntimeInvisibleAnnotations(AttrContainer container)
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> clas)
public static <T extends java.lang.annotation.Annotation> T getAnnotation(AttrContainer container, java.lang.Class<T> clas)
public static void maybeAddAnnotation(AttrContainer container, AnnotationEntry annotation)
RUNTIME
,
add to the RuntimeVisibleAnnotations
attribute.
If the annotation's retention policy is CLASS
,
add to the RuntimeInvisibleAnnotations
attribute.
Otherwise, ignore the annotation.public void addAnnotation(AnnotationEntry ann)
public int getLength()
public void print(ClassTypeWriter dst)
public void assignConstants(ClassType cl)
Attribute
assignConstants
in class Attribute