|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.classfile.Annotation
This class represents an annotation structure in a classfile.
| Nested Class Summary | |
private class |
Annotation.ElementValuePair
Nested class representing name/value pair in an annotation structure. |
| Field Summary | |
private ArrayList |
elementValuePairs
The element-value pairs associated with this annotation |
private AsciiConstant |
name
|
private String |
typeName
|
| Constructor Summary | |
Annotation(String typeName)
Create an empty annotation of a given type. |
|
Annotation(ConstantPool cp,
DataInput in)
Read an annotation structure from a classfile. |
|
| Method Summary | |
void |
addElement(String name,
AnnotElementValue value)
Add an element-value pair to the annotation. |
String |
getName()
Return the name of the annotation, i.e. the name of the interface type. |
(package private) int |
getSize()
Return the size of this annotation structure in bytes. |
AnnotElementValue |
getValue(String elementName)
Return the value of the given element in the notation, or null if the annotation does not contain such an element. |
(package private) void |
resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool. |
String |
toString()
Return a string representation of this annotation. |
(package private) void |
write(ConstantPool cp,
DataOutput out)
Write the annotation structure to a classfile. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private String typeName
private AsciiConstant name
private ArrayList elementValuePairs
| Constructor Detail |
public Annotation(ConstantPool cp,
DataInput in)
throws IOException,
ClassFileFormatException
IOException
ClassFileFormatExceptionpublic Annotation(String typeName)
| Method Detail |
public void addElement(String name,
AnnotElementValue value)
public AnnotElementValue getValue(String elementName)
public String getName()
void resolveConstants(ConstantPool cp)
cp - the constant pool for this class
void write(ConstantPool cp,
DataOutput out)
throws IOException
IOExceptionint getSize()
public String toString()
toString in class Object
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||