|
mjc | ||||||||||
| 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 java.util.ArrayList |
elementValuePairs
The element-value pairs associated with this annotation |
private AsciiConstant |
name
|
private java.lang.String |
typeName
|
| Constructor Summary | |
Annotation(java.lang.String typeName)
Create an empty annotation of a given type. |
|
Annotation(ConstantPool cp,
java.io.DataInput in)
Read an annotation structure from a classfile. |
|
| Method Summary | |
void |
addElement(java.lang.String name,
AnnotElementValue value)
Add an element-value pair to the annotation. |
java.lang.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(java.lang.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. |
java.lang.String |
toString()
Return a string representation of this annotation. |
(package private) void |
write(ConstantPool cp,
java.io.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 java.lang.String typeName
private AsciiConstant name
private java.util.ArrayList elementValuePairs
| Constructor Detail |
public Annotation(ConstantPool cp,
java.io.DataInput in)
throws java.io.IOException,
ClassFileFormatException
java.io.IOException
ClassFileFormatExceptionpublic Annotation(java.lang.String typeName)
| Method Detail |
public void addElement(java.lang.String name,
AnnotElementValue value)
public AnnotElementValue getValue(java.lang.String elementName)
public java.lang.String getName()
void resolveConstants(ConstantPool cp)
cp - the constant pool for this class
void write(ConstantPool cp,
java.io.DataOutput out)
throws java.io.IOException
java.io.IOExceptionint getSize()
public java.lang.String toString()
toString in class java.lang.Object
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||