Package com.tonic.parser.attribute
Class RuntimeVisibleAnnotationsAttribute
- java.lang.Object
-
- com.tonic.parser.attribute.Attribute
-
- com.tonic.parser.attribute.RuntimeVisibleAnnotationsAttribute
-
- Direct Known Subclasses:
RuntimeInvisibleAnnotationsAttribute
public class RuntimeVisibleAnnotationsAttribute extends Attribute
The RuntimeVisibleAnnotations or RuntimeInvisibleAnnotations attribute, distinguished by a visibility flag.
-
-
Constructor Summary
Constructors Constructor Description RuntimeVisibleAnnotationsAttribute(String name, ClassFile parent, boolean visible, int nameIndex, int length)Creates the attribute shell for parsing, attached to a class.RuntimeVisibleAnnotationsAttribute(String name, MemberEntry parent, boolean visible, int nameIndex, int length)Creates the attribute shell for parsing, attached to a member.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Annotation>getAnnotations()booleanisVisible()voidread(ClassFile classFile, int length)Reads the attribute data from the class file.voidsetAnnotations(List<Annotation> annotations)StringtoString()voidupdateLength()Recomputes the attribute length field from the current in-memory content.
-
-
-
Constructor Detail
-
RuntimeVisibleAnnotationsAttribute
public RuntimeVisibleAnnotationsAttribute(String name, MemberEntry parent, boolean visible, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a member.- Parameters:
name- the attribute nameparent- the member the attribute belongs tovisible- true for RuntimeVisibleAnnotations, false for RuntimeInvisibleAnnotationsnameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
RuntimeVisibleAnnotationsAttribute
public RuntimeVisibleAnnotationsAttribute(String name, ClassFile parent, boolean visible, int nameIndex, int length)
Creates the attribute shell for parsing, attached to a class.- Parameters:
name- the attribute nameparent- the class the attribute belongs tovisible- true for RuntimeVisibleAnnotations, false for RuntimeInvisibleAnnotationsnameIndex- constant-pool index of the name Utf8length- the attribute length in bytes
-
-
Method Detail
-
getAnnotations
public List<Annotation> getAnnotations()
- Returns:
- the annotations
-
isVisible
public boolean isVisible()
- Returns:
- whether visible
-
setAnnotations
public void setAnnotations(List<Annotation> annotations)
- Parameters:
annotations- the annotation list
-
read
public void read(ClassFile classFile, int length)
Description copied from class:AttributeReads the attribute data from the class file.
-
updateLength
public void updateLength()
Description copied from class:AttributeRecomputes the attribute length field from the current in-memory content.- Specified by:
updateLengthin classAttribute
-
-