Top Description Fields Constructors Methods
com.sun.tools.jxc.ap

public final Class InlineAnnotationReaderImpl

extends AbstractInlineAnnotationReaderImpl<TypeMirror, TypeElement, VariableElement, ExecutableElement>
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.InvocationTargetException, java.util.ArrayList, .Collection, .List, javax.lang.model.element.AnnotationMirror, .Element, .ElementKind, .ExecutableElement, .TypeElement, .VariableElement, javax.lang.model.type.MirroredTypeException, .MirroredTypesException, .TypeMirror, org.glassfish.jaxb.runtime.v2.model.annotation.AbstractInlineAnnotationReaderImpl, .LocatableAnnotation, org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader, .Locatable

AnnotationReader implementation that reads annotation inline from Annoation Processing.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
public static final InlineAnnotationReaderImpl
theInstance

The singleton instance.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected String
private Annotation[]
getAllAnnotations(Element decl, Locatable srcPos)

Gets all the annotations on the given declaration.

public Annotation[]
public Annotation[]
public <A extends Annotation> A
public TypeMirror[]
public TypeMirror
getClassValue(Annotation a, String name)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassValue.

Reads a value of an annotation that returns a Class object.

public <A extends Annotation> A
getFieldAnnotation(Class<A> a, VariableElement f, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getFieldAnnotation.

Reads an annotation on a property that consists of a field.

public <A extends Annotation> A
public <A extends Annotation> A
getMethodParameterAnnotation(Class<A> a, ExecutableElement m, int paramIndex, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getMethodParameterAnnotation.

Reads an annotation on a parameter of the method.

public <A extends Annotation> A
getPackageAnnotation(Class<A> a, TypeElement clazz, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getPackageAnnotation.

Reads an annotation on the package that the given class belongs to.

public boolean
hasClassAnnotation(TypeElement clazz, Class<? extends Annotation> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasClassAnnotation.

Checks if a class has the annotation.

public boolean
hasFieldAnnotation(Class<? extends Annotation> annotationType, VariableElement f)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasFieldAnnotation.

Checks if the given field has an annotation.

public boolean
Inherited from org.glassfish.jaxb.runtime.v2.model.annotation.AbstractInlineAnnotationReaderImpl:
getErrorHandlergetMethodAnnotationhasMethodAnnotationsetErrorHandler

Field Detail

theInstanceback to summary
public static final InlineAnnotationReaderImpl theInstance

The singleton instance.

Constructor Detail

InlineAnnotationReaderImplback to summary
private InlineAnnotationReaderImpl()

Method Detail

fullNameback to summary
protected String fullName(ExecutableElement m)

Implements abstract org.glassfish.jaxb.runtime.v2.model.annotation.AbstractInlineAnnotationReaderImpl.fullName.

Doc from org.glassfish.jaxb.runtime.v2.model.annotation.AbstractInlineAnnotationReaderImpl.fullName.

Gets the fully-qualified name of the method. Used for error messages.

Annotations
@Override
getAllAnnotationsback to summary
private Annotation[] getAllAnnotations(Element decl, Locatable srcPos)

Gets all the annotations on the given declaration.

getAllFieldAnnotationsback to summary
public Annotation[] getAllFieldAnnotations(VariableElement field, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getAllFieldAnnotations.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getAllFieldAnnotations.

Gets all the annotations on a field.

Annotations
@Override
getAllMethodAnnotationsback to summary
public Annotation[] getAllMethodAnnotations(ExecutableElement method, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getAllMethodAnnotations.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getAllMethodAnnotations.

Gets all the annotations on a method.

Annotations
@Override
getClassAnnotationback to summary
public <A extends Annotation> A getClassAnnotation(Class<A> a, TypeElement clazz, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassAnnotation.

Reads an annotation on a class.

Annotations
@Override
getClassArrayValueback to summary
public TypeMirror[] getClassArrayValue(Annotation a, String name)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassArrayValue.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassArrayValue.

Similar to getClassValue(Annotation, String) method but obtains an array parameter.

Annotations
@Override
getClassValueback to summary
public TypeMirror getClassValue(Annotation a, String name)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassValue.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getClassValue.

Reads a value of an annotation that returns a Class object.

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.

Annotations
@Override
getFieldAnnotationback to summary
public <A extends Annotation> A getFieldAnnotation(Class<A> a, VariableElement f, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getFieldAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getFieldAnnotation.

Reads an annotation on a property that consists of a field.

Annotations
@Override
getMethodAnnotationback to summary
public <A extends Annotation> A getMethodAnnotation(Class<A> a, ExecutableElement method, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getMethodAnnotation.

Annotations
@Override
getMethodParameterAnnotationback to summary
public <A extends Annotation> A getMethodParameterAnnotation(Class<A> a, ExecutableElement m, int paramIndex, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getMethodParameterAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getMethodParameterAnnotation.

Reads an annotation on a parameter of the method.

Annotations
@Override
getPackageAnnotationback to summary
public <A extends Annotation> A getPackageAnnotation(Class<A> a, TypeElement clazz, Locatable srcPos)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getPackageAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.getPackageAnnotation.

Reads an annotation on the package that the given class belongs to.

Annotations
@Override
hasClassAnnotationback to summary
public boolean hasClassAnnotation(TypeElement clazz, Class<? extends Annotation> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasClassAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasClassAnnotation.

Checks if a class has the annotation.

Annotations
@Override
hasFieldAnnotationback to summary
public boolean hasFieldAnnotation(Class<? extends Annotation> annotationType, VariableElement f)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasFieldAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasFieldAnnotation.

Checks if the given field has an annotation.

Annotations
@Override
hasMethodAnnotationback to summary
public boolean hasMethodAnnotation(Class<? extends Annotation> a, ExecutableElement method)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader.hasMethodAnnotation.

Annotations
@Override