|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.classloader.RVMAnnotation
public final class RVMAnnotation
Internal representation of an annotation. We use a proxy class to implement
actual annotations RVMClass
.
Nested Class Summary | |
---|---|
private class |
RVMAnnotation.AnnotationFactory
Class used to implement annotations as proxies |
private static class |
RVMAnnotation.AnnotationMember
A class to decode and hold the name and its associated value for an annotation member |
Field Summary | |
---|---|
private RVMAnnotation.AnnotationMember[] |
elementValuePairs
Members of this annotation |
private static Object |
NO_VALUE
Encoding of when a result cannot be returned |
private TypeReference |
type
The type of the annotation. |
private static ImmutableEntryHashMapRVM<RVMAnnotation,RVMAnnotation> |
uniqueMap
Remembered unique annotations |
private Annotation |
value
The concrete annotation represented by this RVMAnnotation |
Constructor Summary | |
---|---|
private |
RVMAnnotation(TypeReference type,
RVMAnnotation.AnnotationMember[] elementValuePairs)
Construct a read annotation |
Method Summary | ||
---|---|---|
private boolean |
annotationEquals(Annotation a,
Annotation b)
Are two annotations equal? |
|
private int |
annotationHashCode()
Hash code for annotation value |
|
(package private) TypeReference |
annotationType()
Return the TypeReference of the declared annotation, ie an interface and not the class object of this instance |
|
private Annotation |
createValue()
Create an instance of this type of annotation with the values given in the members |
|
private String |
elementString(String name,
Object value)
String representation of the value pair of the form "name=value" |
|
boolean |
equals(Object o)
|
|
(package private) static Object |
firstUse(Object value)
Handle late resolution of class value annotations |
|
private Object |
getElementValue(String name,
Class<?> valueType)
Find the value for an annotation |
|
(package private) Annotation |
getValue()
Return the annotation represented by this RVMAnnotation. |
|
int |
hashCode()
|
|
(package private) static RVMAnnotation |
readAnnotation(int[] constantPool,
DataInputStream input,
ClassLoader classLoader)
Read an annotation attribute from the class file |
|
(package private) static
|
readValue(TypeReference type,
int[] constantPool,
DataInputStream input,
ClassLoader classLoader)
Read the element_value field of an annotation |
|
private static
|
readValue(TypeReference type,
int[] constantPool,
DataInputStream input,
ClassLoader classLoader,
byte elementValue_tag)
|
|
String |
toString()
Return a string representation of the annotation of the form "@type(name1=val1, ...nameN=valN)" |
|
private static String |
toStringHelper(Object value)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private final TypeReference type
private final RVMAnnotation.AnnotationMember[] elementValuePairs
private static final ImmutableEntryHashMapRVM<RVMAnnotation,RVMAnnotation> uniqueMap
private Annotation value
private static final Object NO_VALUE
Constructor Detail |
---|
private RVMAnnotation(TypeReference type, RVMAnnotation.AnnotationMember[] elementValuePairs)
type
- the name of the type this annotation's value will
implementelementValuePairs
- values for the fields in the annotation
that override the defaultsMethod Detail |
---|
static RVMAnnotation readAnnotation(int[] constantPool, DataInputStream input, ClassLoader classLoader) throws IOException, ClassNotFoundException
constantPool
- from constant pool being loadedinput
- the data being read
IOException
ClassNotFoundException
Annotation getValue()
private Annotation createValue()
static <T> Object readValue(TypeReference type, int[] constantPool, DataInputStream input, ClassLoader classLoader) throws IOException, ClassNotFoundException
type
- the type of the value to read or nullconstantPool
- the constant pool for the class being readinput
- stream to read from
IOException
ClassNotFoundException
private static <T> Object readValue(TypeReference type, int[] constantPool, DataInputStream input, ClassLoader classLoader, byte elementValue_tag) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
static Object firstUse(Object value)
TypeReference annotationType()
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
public String toString()
toString
in class Object
private String elementString(String name, Object value)
private static String toStringHelper(Object value)
private Object getElementValue(String name, Class<?> valueType)
private int annotationHashCode()
private boolean annotationEquals(Annotation a, Annotation b)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |