|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader
public final class RuntimeInlineAnnotationReader
AnnotationReader
that uses java.lang.reflect
to
read annotations from class files.
Constructor Summary | |
---|---|
RuntimeInlineAnnotationReader()
|
Method Summary | ||
---|---|---|
protected java.lang.String |
fullName(java.lang.reflect.Method m)
Gets the fully-qualified name of the method. |
|
java.lang.annotation.Annotation[] |
getAllFieldAnnotations(java.lang.reflect.Field field,
Locatable srcPos)
Gets all the annotations on a field. |
|
java.lang.annotation.Annotation[] |
getAllMethodAnnotations(java.lang.reflect.Method method,
Locatable srcPos)
Gets all the annotations on a method. |
|
|
getClassAnnotation(java.lang.Class<A> a,
java.lang.Class clazz,
Locatable srcPos)
Reads an annotation on a class. |
|
java.lang.Class[] |
getClassArrayValue(java.lang.annotation.Annotation a,
java.lang.String name)
Similar to AnnotationReader.getClassValue(Annotation, String) method but
obtains an array parameter. |
|
java.lang.Class |
getClassValue(java.lang.annotation.Annotation a,
java.lang.String name)
Reads a value of an annotation that returns a Class object. |
|
|
getFieldAnnotation(java.lang.Class<A> annotation,
java.lang.reflect.Field field,
Locatable srcPos)
Reads an annotation on a property that consists of a field. |
|
|
getMethodAnnotation(java.lang.Class<A> annotation,
java.lang.reflect.Method method,
Locatable srcPos)
|
|
|
getMethodParameterAnnotation(java.lang.Class<A> annotation,
java.lang.reflect.Method method,
int paramIndex,
Locatable srcPos)
Reads an annotation on a parameter of the method. |
|
|
getPackageAnnotation(java.lang.Class<A> a,
java.lang.Class clazz,
Locatable srcPos)
Reads an annotation on the package that the given class belongs to. |
|
boolean |
hasClassAnnotation(java.lang.Class clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Checks if a class has the annotation. |
|
boolean |
hasFieldAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
java.lang.reflect.Field field)
Checks if the given field has an annotation. |
|
boolean |
hasMethodAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
java.lang.reflect.Method method)
|
Methods inherited from class com.sun.xml.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl |
---|
getErrorHandler, getMethodAnnotation, hasMethodAnnotation, setErrorHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.xml.bind.v2.model.annotation.AnnotationReader |
---|
getMethodAnnotation, hasMethodAnnotation, setErrorHandler |
Constructor Detail |
---|
public RuntimeInlineAnnotationReader()
Method Detail |
---|
public <A extends java.lang.annotation.Annotation> A getFieldAnnotation(java.lang.Class<A> annotation, java.lang.reflect.Field field, Locatable srcPos)
AnnotationReader
getFieldAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public boolean hasFieldAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, java.lang.reflect.Field field)
AnnotationReader
hasFieldAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public boolean hasClassAnnotation(java.lang.Class clazz, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
AnnotationReader
hasClassAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public java.lang.annotation.Annotation[] getAllFieldAnnotations(java.lang.reflect.Field field, Locatable srcPos)
AnnotationReader
getAllFieldAnnotations
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public <A extends java.lang.annotation.Annotation> A getMethodAnnotation(java.lang.Class<A> annotation, java.lang.reflect.Method method, Locatable srcPos)
getMethodAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public boolean hasMethodAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotation, java.lang.reflect.Method method)
hasMethodAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public java.lang.annotation.Annotation[] getAllMethodAnnotations(java.lang.reflect.Method method, Locatable srcPos)
AnnotationReader
getAllMethodAnnotations
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
srcPos
- the location from which this annotation is read.public <A extends java.lang.annotation.Annotation> A getMethodParameterAnnotation(java.lang.Class<A> annotation, java.lang.reflect.Method method, int paramIndex, Locatable srcPos)
AnnotationReader
getMethodParameterAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public <A extends java.lang.annotation.Annotation> A getClassAnnotation(java.lang.Class<A> a, java.lang.Class clazz, Locatable srcPos)
AnnotationReader
getClassAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public <A extends java.lang.annotation.Annotation> A getPackageAnnotation(java.lang.Class<A> a, java.lang.Class clazz, Locatable srcPos)
AnnotationReader
getPackageAnnotation
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
public java.lang.Class getClassValue(java.lang.annotation.Annotation a, java.lang.String name)
AnnotationReader
Depending on the underlying reflection library, you can't always
obtain the Class
object directly (see the APT MirrorTypeException
for example), so use this method to avoid that.
getClassValue
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
name
- The name of the annotation parameter to be read.public java.lang.Class[] getClassArrayValue(java.lang.annotation.Annotation a, java.lang.String name)
AnnotationReader
AnnotationReader.getClassValue(Annotation, String)
method but
obtains an array parameter.
getClassArrayValue
in interface AnnotationReader<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
protected java.lang.String fullName(java.lang.reflect.Method m)
AbstractInlineAnnotationReaderImpl
fullName
in class AbstractInlineAnnotationReaderImpl<java.lang.reflect.Type,java.lang.Class,java.lang.reflect.Field,java.lang.reflect.Method>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |