|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.asm.attrs.Annotation
Annotation data contains an annotated type and its array of the member-value pairs. Structure is in the following format:
annotation { u2 type_index; u2 num_member_value_pairs; { u2 member_name_index; member_value value; } member_value_pairs[num_member_value_pairs]; }The items of the annotation structure are as follows:
Field Summary | |
List |
memberValues
|
String |
type
|
Constructor Summary | |
Annotation()
|
Method Summary | |
void |
add(String name,
Object value)
|
void |
dump(StringBuffer buf,
String varName)
|
static void |
dumpAnnotations(StringBuffer buf,
String varName,
List annotations)
|
static void |
dumpParameterAnnotations(StringBuffer buf,
String varName,
List parameters)
|
int |
read(ClassReader cr,
int off,
char[] buf)
Reads annotation data structures. |
static int |
readAnnotations(List annotations,
ClassReader cr,
int off,
char[] buf)
Utility method to read List of annotations. |
static void |
readParameterAnnotations(List parameters,
ClassReader cr,
int off,
char[] buf)
Utility method to read List of parameters annotations. |
static String |
stringAnnotations(List annotations)
Returns annotation values in the format described in JSR-175 for Java source code. |
static String |
stringParameterAnnotations(List parameters)
Returns parameter annotation values in the format described in JSR-175 for Java source code. |
String |
toString()
Returns value in the format described in JSR-175 for Java source code. |
void |
write(ByteVector bv,
ClassWriter cw)
Writes annotation data structures. |
static ByteVector |
writeAnnotations(ByteVector bv,
List annotations,
ClassWriter cw)
Utility method to write List of annotations. |
static ByteVector |
writeParametersAnnotations(ByteVector bv,
List parameters,
ClassWriter cw)
Utility method to write List of parameters annotations. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public String type
public List memberValues
Constructor Detail |
public Annotation()
Method Detail |
public void add(String name, Object value)
public int read(ClassReader cr, int off, char[] buf)
cr
- the class that contains the attribute to be read.off
- index of the first byte of the data structure.buf
- buffer to be used to call readUTF8
,
readClass
or readConst
.
public void write(ByteVector bv, ClassWriter cw)
bv
- the byte array form to store data structures.cw
- the class to which this attribute must be added. This parameter
can be used to add to the constant pool of this class the items that
corresponds to this attribute.public void dump(StringBuffer buf, String varName)
public static int readAnnotations(List annotations, ClassReader cr, int off, char[] buf)
annotations
- the List to store parameters annotations.cr
- the class that contains the attribute to be read.off
- index of the first byte of the data structure.buf
- buffer to be used to call readUTF8
,
readClass
or readConst
.
public static void readParameterAnnotations(List parameters, ClassReader cr, int off, char[] buf)
parameters
- the List to store parameters annotations.
Each element of the parameters List will have List of Annotation
instances.cr
- the class that contains the attribute to be read.off
- index of the first byte of the data structure.buf
- buffer to be used to call readUTF8
,
readClass
or readConst
.public static ByteVector writeAnnotations(ByteVector bv, List annotations, ClassWriter cw)
bv
- the byte array form to store data structures.annotations
- the List of annotations to write.
Elements should be instances of the Annotation class.cw
- the class to which this attribute must be added. This parameter
can be used to add to the constant pool of this class the items that
corresponds to this attribute.
public static ByteVector writeParametersAnnotations(ByteVector bv, List parameters, ClassWriter cw)
bv
- the byte array form to store data structures.parameters
- the List of parametars to write. Elements should be
instances of the List that contains instances of the Annotation class.cw
- the class to which this attribute must be added. This parameter
can be used to add to the constant pool of this class the items that
corresponds to this attribute.
public static void dumpAnnotations(StringBuffer buf, String varName, List annotations)
public static void dumpParameterAnnotations(StringBuffer buf, String varName, List parameters)
public static String stringAnnotations(List annotations)
public static String stringParameterAnnotations(List parameters)
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |