Class AnnotationEntryGen
java.lang.Object
org.apache.bcel.generic.AnnotationEntryGen
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationEntryGen(AnnotationEntry a, ConstantPoolGen cpool, boolean copyPoolEntries) Here we are taking a fixed annotation of type Annotation and building a modifiable AnnotationGen object.AnnotationEntryGen(ObjectType type, List<ElementValuePairGen> elements, boolean vis, ConstantPoolGen cpool) Constructs an AnnotationEntryGen. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an element name value pair.voiddump(DataOutputStream dos) Dumps this annotation entry to a DataOutputStream.Retrieves an immutable version of this AnnotationGen.intGets the type index.final StringGets the type name.final StringGets the type signature.Returns list of ElementNameValuePair objects.booleanGets whether this annotation is runtime visible.static AnnotationEntryGenread(DataInput dis, ConstantPoolGen cpool, boolean b) Reads an AnnotationEntryGen from a DataInput.Returns a short string representation of this annotation.toString()
-
Constructor Details
-
AnnotationEntryGen
Here we are taking a fixed annotation of type Annotation and building a modifiable AnnotationGen object. If the pool passed in is for a different class file, then copyPoolEntries should have been passed as true as that will force us to do a deep copy of the annotation and move the cpool entries across. We need to copy the type and the element name value pairs and the visibility.- Parameters:
a- the annotation entry.cpool- the constant pool generator.copyPoolEntries- whether to copy pool entries.
-
AnnotationEntryGen
public AnnotationEntryGen(ObjectType type, List<ElementValuePairGen> elements, boolean vis, ConstantPoolGen cpool) Constructs an AnnotationEntryGen.- Parameters:
type- the object type.elements- the element value pairs.vis- whether the annotation is visible.cpool- the constant pool generator.
-
-
Method Details
-
read
public static AnnotationEntryGen read(DataInput dis, ConstantPoolGen cpool, boolean b) throws IOException Reads an AnnotationEntryGen from a DataInput.- Parameters:
dis- the data input stream.cpool- the constant pool generator.b- whether the annotation is runtime visible.- Returns:
- the annotation entry generator.
- Throws:
IOException- if an I/O error occurs.
-
addElementNameValuePair
Adds an element name value pair.- Parameters:
evp- the element value pair generator.
-
dump
Dumps this annotation entry to a DataOutputStream.- Parameters:
dos- the data output stream.- Throws:
IOException- if an I/O error occurs.
-
getAnnotation
Retrieves an immutable version of this AnnotationGen.- Returns:
- an immutable version of this AnnotationGen.
-
getTypeIndex
-
getTypeName
-
getTypeSignature
-
getValues
Returns list of ElementNameValuePair objects.- Returns:
- list of ElementNameValuePair objects.
-
isRuntimeVisible
Gets whether this annotation is runtime visible.- Returns:
- true if this annotation is runtime visible.
-
toShortString
Returns a short string representation of this annotation.- Returns:
- a short string representation of this annotation.
-
toString
-