public final class RuntimeInlineAnnotationReader extends AbstractInlineAnnotationReaderImpl<Type,Class,Field,Method> implements RuntimeAnnotationReader
AnnotationReader
that uses java.lang.reflect
to
read annotations from class files.Constructor and Description |
---|
RuntimeInlineAnnotationReader() |
Modifier and Type | Method and Description |
---|---|
protected String |
fullName(Method m)
Gets the fully-qualified name of the method.
|
Annotation[] |
getAllFieldAnnotations(Field field,
Locatable srcPos)
Gets all the annotations on a field.
|
Annotation[] |
getAllMethodAnnotations(Method method,
Locatable srcPos)
Gets all the annotations on a method.
|
<A extends Annotation> |
getClassAnnotation(Class<A> a,
Class clazz,
Locatable srcPos)
Reads an annotation on a class.
|
Class[] |
getClassArrayValue(Annotation a,
String name)
Similar to
AnnotationReader.getClassValue(Annotation, String) method but
obtains an array parameter. |
Class |
getClassValue(Annotation a,
String name)
Reads a value of an annotation that returns a Class object.
|
<A extends Annotation> |
getFieldAnnotation(Class<A> annotation,
Field field,
Locatable srcPos)
Reads an annotation on a property that consists of a field.
|
<A extends Annotation> |
getMethodAnnotation(Class<A> annotation,
Method method,
Locatable srcPos) |
<A extends Annotation> |
getMethodParameterAnnotation(Class<A> annotation,
Method method,
int paramIndex,
Locatable srcPos)
Reads an annotation on a parameter of the method.
|
<A extends Annotation> |
getPackageAnnotation(Class<A> a,
Class clazz,
Locatable srcPos)
Reads an annotation on the package that the given class belongs to.
|
boolean |
hasClassAnnotation(Class clazz,
Class<? extends Annotation> annotationType)
Checks if a class has the annotation.
|
boolean |
hasFieldAnnotation(Class<? extends Annotation> annotationType,
Field field)
Checks if the given field has an annotation.
|
boolean |
hasMethodAnnotation(Class<? extends Annotation> annotation,
Method method) |
getErrorHandler, getMethodAnnotation, hasMethodAnnotation, setErrorHandler
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMethodAnnotation, hasMethodAnnotation, setErrorHandler
public <A extends Annotation> A getFieldAnnotation(Class<A> annotation, Field field, Locatable srcPos)
AnnotationReader
getFieldAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public boolean hasFieldAnnotation(Class<? extends Annotation> annotationType, Field field)
AnnotationReader
hasFieldAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public boolean hasClassAnnotation(Class clazz, Class<? extends Annotation> annotationType)
AnnotationReader
hasClassAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public Annotation[] getAllFieldAnnotations(Field field, Locatable srcPos)
AnnotationReader
getAllFieldAnnotations
in interface AnnotationReader<Type,Class,Field,Method>
public <A extends Annotation> A getMethodAnnotation(Class<A> annotation, Method method, Locatable srcPos)
getMethodAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public boolean hasMethodAnnotation(Class<? extends Annotation> annotation, Method method)
hasMethodAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public Annotation[] getAllMethodAnnotations(Method method, Locatable srcPos)
AnnotationReader
getAllMethodAnnotations
in interface AnnotationReader<Type,Class,Field,Method>
srcPos
- the location from which this annotation is read.public <A extends Annotation> A getMethodParameterAnnotation(Class<A> annotation, Method method, int paramIndex, Locatable srcPos)
AnnotationReader
getMethodParameterAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public <A extends Annotation> A getClassAnnotation(Class<A> a, Class clazz, Locatable srcPos)
AnnotationReader
getClassAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public <A extends Annotation> A getPackageAnnotation(Class<A> a, Class clazz, Locatable srcPos)
AnnotationReader
getPackageAnnotation
in interface AnnotationReader<Type,Class,Field,Method>
public Class getClassValue(Annotation a, String name)
AnnotationReader
Depending on the underlying reflection library, you can't always
obtain the Class
object directly (see the Annotation Processing MirrorTypeException
for example), so use this method to avoid that.
getClassValue
in interface AnnotationReader<Type,Class,Field,Method>
name
- The name of the annotation parameter to be read.public Class[] getClassArrayValue(Annotation a, String name)
AnnotationReader
AnnotationReader.getClassValue(Annotation, String)
method but
obtains an array parameter.getClassArrayValue
in interface AnnotationReader<Type,Class,Field,Method>
protected String fullName(Method m)
AbstractInlineAnnotationReaderImpl
Copyright © 2017 JBoss by Red Hat. All rights reserved.