Package org.apache.bcel.classfile
Class AnnotationEntry
- java.lang.Object
-
- org.apache.bcel.classfile.AnnotationEntry
-
-
Field Summary
Fields Modifier and Type Field Description private ConstantPoolconstantPoolprivate java.util.List<ElementValuePair>elementValuePairsstatic AnnotationEntry[]EMPTY_ARRAYprivate booleanisRuntimeVisibleprivate inttypeIndex
-
Constructor Summary
Constructors Constructor Description AnnotationEntry(int typeIndex, ConstantPool constantPool, boolean isRuntimeVisible)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor v)Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class.voidaddElementNameValuePair(ElementValuePair elementNameValuePair)static AnnotationEntry[]createAnnotationEntries(Attribute[] attrs)voiddump(java.io.DataOutputStream dos)java.lang.StringgetAnnotationType()intgetAnnotationTypeIndex()ConstantPoolgetConstantPool()ElementValuePair[]getElementValuePairs()intgetNumElementValuePairs()intgetTypeIndex()booleanisRuntimeVisible()static AnnotationEntryread(java.io.DataInput input, ConstantPool constantPool, boolean isRuntimeVisible)Factory method to create an AnnotionEntry from a DataInputjava.lang.StringtoShortString()java.lang.StringtoString()
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final AnnotationEntry[] EMPTY_ARRAY
-
typeIndex
private final int typeIndex
-
constantPool
private final ConstantPool constantPool
-
isRuntimeVisible
private final boolean isRuntimeVisible
-
elementValuePairs
private final java.util.List<ElementValuePair> elementValuePairs
-
-
Constructor Detail
-
AnnotationEntry
public AnnotationEntry(int typeIndex, ConstantPool constantPool, boolean isRuntimeVisible)
-
-
Method Detail
-
createAnnotationEntries
public static AnnotationEntry[] createAnnotationEntries(Attribute[] attrs)
-
read
public static AnnotationEntry read(java.io.DataInput input, ConstantPool constantPool, boolean isRuntimeVisible) throws java.io.IOException
Factory method to create an AnnotionEntry from a DataInput- Parameters:
input-constantPool-isRuntimeVisible-- Returns:
- the entry
- Throws:
java.io.IOException- if an I/O error occurs.
-
accept
public void accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects.
-
addElementNameValuePair
public void addElementNameValuePair(ElementValuePair elementNameValuePair)
-
dump
public void dump(java.io.DataOutputStream dos) throws java.io.IOException- Throws:
java.io.IOException
-
getAnnotationType
public java.lang.String getAnnotationType()
- Returns:
- the annotation type name
-
getAnnotationTypeIndex
public int getAnnotationTypeIndex()
- Returns:
- the annotation type index
-
getConstantPool
public ConstantPool getConstantPool()
-
getElementValuePairs
public ElementValuePair[] getElementValuePairs()
- Returns:
- the element value pairs in this annotation entry
-
getNumElementValuePairs
public final int getNumElementValuePairs()
- Returns:
- the number of element value pairs in this annotation entry
-
getTypeIndex
public int getTypeIndex()
-
isRuntimeVisible
public boolean isRuntimeVisible()
-
toShortString
public java.lang.String toShortString()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-