Package com.sun.tools.jxc.ap
Class InlineAnnotationReaderImpl
java.lang.Object
com.sun.xml.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl<TypeMirror,TypeElement,VariableElement,ExecutableElement>
com.sun.tools.jxc.ap.InlineAnnotationReaderImpl
- All Implemented Interfaces:
AnnotationReader<TypeMirror,TypeElement, VariableElement, ExecutableElement>
public final class InlineAnnotationReaderImpl
extends AbstractInlineAnnotationReaderImpl<TypeMirror,TypeElement,VariableElement,ExecutableElement>
AnnotationReader implementation that reads annotation inline from Annoation Processing.- Author:
- Kohsuke Kawaguchi (kk@kohsuke.org)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGets the fully-qualified name of the method.getAllFieldAnnotations(VariableElement field, Locatable srcPos) Gets all the annotations on a field.getAllMethodAnnotations(ExecutableElement method, Locatable srcPos) Gets all the annotations on a method.<A extends Annotation>
AgetClassAnnotation(Class<A> a, TypeElement clazz, Locatable srcPos) Reads an annotation on a class.getClassArrayValue(Annotation a, String name) Similar toAnnotationReader.getClassValue(Annotation, String)method but obtains an array parameter.getClassValue(Annotation a, String name) Reads a value of an annotation that returns a Class object.<A extends Annotation>
AgetFieldAnnotation(Class<A> a, VariableElement f, Locatable srcPos) Reads an annotation on a property that consists of a field.<A extends Annotation>
AgetMethodAnnotation(Class<A> a, ExecutableElement method, Locatable srcPos) <A extends Annotation>
AgetMethodParameterAnnotation(Class<A> a, ExecutableElement m, int paramIndex, Locatable srcPos) Reads an annotation on a parameter of the method.<A extends Annotation>
AgetPackageAnnotation(Class<A> a, TypeElement clazz, Locatable srcPos) Reads an annotation on the package that the given class belongs to.booleanhasClassAnnotation(TypeElement clazz, Class<? extends Annotation> annotationType) Checks if a class has the annotation.booleanhasFieldAnnotation(Class<? extends Annotation> annotationType, VariableElement f) Checks if the given field has an annotation.booleanhasMethodAnnotation(Class<? extends Annotation> a, ExecutableElement method) Methods inherited from class com.sun.xml.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl
getErrorHandler, getMethodAnnotation, hasMethodAnnotation, setErrorHandler
-
Field Details
-
theInstance
The singleton instance.
-
-
Method Details
-
getClassAnnotation
Description copied from interface:AnnotationReaderReads an annotation on a class. -
getFieldAnnotation
Description copied from interface:AnnotationReaderReads an annotation on a property that consists of a field. -
hasFieldAnnotation
Description copied from interface:AnnotationReaderChecks if the given field has an annotation. -
hasClassAnnotation
Description copied from interface:AnnotationReaderChecks if a class has the annotation. -
getAllFieldAnnotations
Description copied from interface:AnnotationReaderGets all the annotations on a field. -
getMethodAnnotation
public <A extends Annotation> A getMethodAnnotation(Class<A> a, ExecutableElement method, Locatable srcPos) -
hasMethodAnnotation
-
getAllMethodAnnotations
Description copied from interface:AnnotationReaderGets all the annotations on a method.srcPos- the location from which this annotation is read.
-
getMethodParameterAnnotation
public <A extends Annotation> A getMethodParameterAnnotation(Class<A> a, ExecutableElement m, int paramIndex, Locatable srcPos) Description copied from interface:AnnotationReaderReads an annotation on a parameter of the method.- Returns:
- null if the annotation was not found.
-
getPackageAnnotation
public <A extends Annotation> A getPackageAnnotation(Class<A> a, TypeElement clazz, Locatable srcPos) Description copied from interface:AnnotationReaderReads an annotation on the package that the given class belongs to. -
getClassValue
Description copied from interface:AnnotationReaderReads a value of an annotation that returns a Class object.Depending on the underlying reflection library, you can't always obtain the
Classobject 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.
-
getClassArrayValue
Description copied from interface:AnnotationReaderSimilar toAnnotationReader.getClassValue(Annotation, String)method but obtains an array parameter. -
fullName
Description copied from class:AbstractInlineAnnotationReaderImplGets the fully-qualified name of the method. Used for error messages.- Specified by:
fullNamein classAbstractInlineAnnotationReaderImpl<TypeMirror,TypeElement, VariableElement, ExecutableElement>
-