|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) B32476-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.toplink.libraries.asm.attrs.Annotation
public class Annotation
Annotation data contains an annotated type and its array of the element-value pairs. Structure is in the following format:
annotation { u2 type_index; u2 num_element_value_pairs; { u2 element_name_index; element_value value; } element_value_pairs[num_element_value_pairs]; }The items of the annotation structure are as follows:
The element_value structure has the following format:
element_value { u1 tag; union { u2 const_value_index; { u2 type_name_index; u2 const_name_index; } enum_const_value; u2 class_info_index; annotation annotation_value; { u2 num_values; element_value values[num_values]; } array_value; } value; }The items of the element_value structure are as follows:
tag value Element Type 's' String 'e' enum constant 'c' class '@' annotation type '[' array
annotation
.element_value structure
.
Nested Class Summary | |
---|---|
static class |
Annotation.EnumConstValue
Container class used to store enum_const_value structure. |
Field Summary | |
---|---|
java.util.List |
elementValues
List of Object[]{name, value} pairs. |
java.lang.String |
type
A fully qualified class name in internal form (see Type ). |
Constructor Summary | |
---|---|
Annotation()
|
|
Annotation(java.lang.String type)
|
Method Summary | |
---|---|
void |
add(java.lang.String name,
java.lang.Object value)
|
int |
read(ClassReader cr,
int off,
char[] buf)
Reads annotation data structures. |
static int |
readAnnotations(java.util.List annotations,
ClassReader cr,
int off,
char[] buf)
Utility method to read List of annotations. |
static void |
readParameterAnnotations(java.util.List parameters,
ClassReader cr,
int off,
char[] buf)
Utility method to read List of parameters annotations. |
static java.lang.String |
stringAnnotations(java.util.List annotations)
Returns annotation values in the format described in JSR-175 for Java source code. |
static java.lang.String |
stringParameterAnnotations(java.util.List parameters)
Returns parameter annotation values in the format described in JSR-175 for Java source code. |
java.lang.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,
java.util.List annotations,
ClassWriter cw)
Utility method to write List of annotations. |
static ByteVector |
writeParametersAnnotations(ByteVector bv,
java.util.List parameters,
ClassWriter cw)
Utility method to write List of parameters annotations. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String type
Annotation
Type
).
public java.util.List elementValues
Annotation
List
of Object[]{name, value}
pairs.
Where name is String
and value is one of
Byte
, Character
, Double
,
Float
, Integer
, Long
, Short
,
Boolean
, String
,
Annotation.EnumConstValue
, Type
,
Annotation
or Object[]
.
Constructor Detail |
---|
public Annotation()
public Annotation(java.lang.String type)
Method Detail |
---|
public void add(java.lang.String name, java.lang.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 static int readAnnotations(java.util.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(java.util.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, java.util.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, java.util.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 java.lang.String stringAnnotations(java.util.List annotations)
annotations
- a list of annotations.
public static java.lang.String stringParameterAnnotations(java.util.List parameters)
parameters
- a list of parameter annotations.
public java.lang.String toString()
toString
in class java.lang.Object
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |