AnnotationReader<javax.lang.model.type.TypeMirror,javax.lang.model.element.TypeElement,javax.lang.model.element.VariableElement,javax.lang.model.element.ExecutableElement>public final class InlineAnnotationReaderImpl extends AbstractInlineAnnotationReaderImpl<javax.lang.model.type.TypeMirror,javax.lang.model.element.TypeElement,javax.lang.model.element.VariableElement,javax.lang.model.element.ExecutableElement>
AnnotationReader implementation that reads annotation inline from Annoation Processing.| Modifier and Type | Field | Description |
|---|---|---|
static InlineAnnotationReaderImpl |
theInstance |
The singleton instance.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.String |
fullName(javax.lang.model.element.ExecutableElement m) |
Gets the fully-qualified name of the method.
|
java.lang.annotation.Annotation[] |
getAllFieldAnnotations(javax.lang.model.element.VariableElement field,
Locatable srcPos) |
Gets all the annotations on a field.
|
java.lang.annotation.Annotation[] |
getAllMethodAnnotations(javax.lang.model.element.ExecutableElement method,
Locatable srcPos) |
Gets all the annotations on a method.
|
<A extends java.lang.annotation.Annotation> |
getClassAnnotation(java.lang.Class<A> a,
javax.lang.model.element.TypeElement clazz,
Locatable srcPos) |
Reads an annotation on a class.
|
javax.lang.model.type.TypeMirror[] |
getClassArrayValue(java.lang.annotation.Annotation a,
java.lang.String name) |
Similar to
AnnotationReader.getClassValue(Annotation, String) method but
obtains an array parameter. |
javax.lang.model.type.TypeMirror |
getClassValue(java.lang.annotation.Annotation a,
java.lang.String name) |
Reads a value of an annotation that returns a Class object.
|
<A extends java.lang.annotation.Annotation> |
getFieldAnnotation(java.lang.Class<A> a,
javax.lang.model.element.VariableElement f,
Locatable srcPos) |
Reads an annotation on a property that consists of a field.
|
<A extends java.lang.annotation.Annotation> |
getMethodAnnotation(java.lang.Class<A> a,
javax.lang.model.element.ExecutableElement method,
Locatable srcPos) |
|
<A extends java.lang.annotation.Annotation> |
getMethodParameterAnnotation(java.lang.Class<A> a,
javax.lang.model.element.ExecutableElement m,
int paramIndex,
Locatable srcPos) |
Reads an annotation on a parameter of the method.
|
<A extends java.lang.annotation.Annotation> |
getPackageAnnotation(java.lang.Class<A> a,
javax.lang.model.element.TypeElement clazz,
Locatable srcPos) |
Reads an annotation on the package that the given class belongs to.
|
boolean |
hasClassAnnotation(javax.lang.model.element.TypeElement 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,
javax.lang.model.element.VariableElement f) |
Checks if the given field has an annotation.
|
boolean |
hasMethodAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> a,
javax.lang.model.element.ExecutableElement method) |
getErrorHandler, getMethodAnnotation, hasMethodAnnotation, setErrorHandlerpublic static final InlineAnnotationReaderImpl theInstance
public <A extends java.lang.annotation.Annotation> A getClassAnnotation(java.lang.Class<A> a,
javax.lang.model.element.TypeElement clazz,
Locatable srcPos)
AnnotationReaderpublic <A extends java.lang.annotation.Annotation> A getFieldAnnotation(java.lang.Class<A> a,
javax.lang.model.element.VariableElement f,
Locatable srcPos)
AnnotationReaderpublic boolean hasFieldAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType,
javax.lang.model.element.VariableElement f)
AnnotationReaderpublic boolean hasClassAnnotation(javax.lang.model.element.TypeElement clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
AnnotationReaderpublic java.lang.annotation.Annotation[] getAllFieldAnnotations(javax.lang.model.element.VariableElement field,
Locatable srcPos)
AnnotationReaderpublic <A extends java.lang.annotation.Annotation> A getMethodAnnotation(java.lang.Class<A> a,
javax.lang.model.element.ExecutableElement method,
Locatable srcPos)
public boolean hasMethodAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> a,
javax.lang.model.element.ExecutableElement method)
public java.lang.annotation.Annotation[] getAllMethodAnnotations(javax.lang.model.element.ExecutableElement method,
Locatable srcPos)
AnnotationReadersrcPos - the location from which this annotation is read.public <A extends java.lang.annotation.Annotation> A getMethodParameterAnnotation(java.lang.Class<A> a,
javax.lang.model.element.ExecutableElement m,
int paramIndex,
Locatable srcPos)
AnnotationReaderpublic <A extends java.lang.annotation.Annotation> A getPackageAnnotation(java.lang.Class<A> a,
javax.lang.model.element.TypeElement clazz,
Locatable srcPos)
AnnotationReaderpublic javax.lang.model.type.TypeMirror 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 Annotation Processing MirrorTypeException
for example), so use this method to avoid that.
name - The name of the annotation parameter to be read.public javax.lang.model.type.TypeMirror[] getClassArrayValue(java.lang.annotation.Annotation a,
java.lang.String name)
AnnotationReaderAnnotationReader.getClassValue(Annotation, String) method but
obtains an array parameter.protected java.lang.String fullName(javax.lang.model.element.ExecutableElement m)
AbstractInlineAnnotationReaderImplfullName in class AbstractInlineAnnotationReaderImpl<javax.lang.model.type.TypeMirror,javax.lang.model.element.TypeElement,javax.lang.model.element.VariableElement,javax.lang.model.element.ExecutableElement>Copyright © 2018 Oracle Corporation. All rights reserved.