|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectAnnotationReader
public class AnnotationReader
This class implements a reader for user defined annotations. It fills a gap in the BCEL-library.
In contrast to Java reflection, where user defined annotations are accessible as Java objects, BCEL extracts user defined annotations, but does not parse them. This must be done by the AnnotationReader.
This is adapted from an implementation by Don Schwarz.
The annotation reader is installed by calling
Attribute.addAttributeReader("RuntimeVisibleAnnotations",new AnnotationReader());
Constructor Summary | |
---|---|
AnnotationReader()
|
Method Summary | |
---|---|
Attribute |
createAttribute(int name_index,
int length,
DataInputStream in,
ConstantPool cp)
This method is called when a class file is parsed by the BCEL-parser. |
Map |
readAnnotation(DataInputStream in,
ConstantPool cp)
This method reads a single annotation |
Object |
readMemberValue(DataInputStream in,
ConstantPool cp)
This method reads the value of a key-value pair. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationReader()
Method Detail |
---|
public Attribute createAttribute(int name_index, int length, DataInputStream in, ConstantPool cp)
AnnotationsAttribute
.
createAttribute
in interface AttributeReader
public Map readAnnotation(DataInputStream in, ConstantPool cp) throws IOException
IOException
public Object readMemberValue(DataInputStream in, ConstantPool cp) throws IOException, UnsupportedOperationException
IOException
UnsupportedOperationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |