Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.model.annotation

public final Class RuntimeInlineAnnotationReader

extends AbstractInlineAnnotationReaderImpl<Type, Class<T>, Field, Method>
implements RuntimeAnnotationReader
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.model.annotation.RuntimeAnnotationReader, org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader
Imports
org.glassfish.jaxb.core.v2.model.annotation.Locatable, java.lang.annotation.Annotation, java.lang.reflect.Field, .InvocationTargetException, .Method, .Type, java.util.HashMap, .Map

org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader that uses java.lang.reflect to read annotations from class files.
Author
Kohsuke Kawaguchi ([email protected])

Field Summary

Modifier and TypeField and Description
private final Map<Class<? extends Annotation>, Map<Package, Annotation>>
packageCache

Cache for package-level annotations.

Constructor Summary

AccessConstructor and Description
public
RuntimeInlineAnnotationReader()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
protected String
fullName(Method m)

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

Gets the fully-qualified name of the method.

public Annotation[]
public Annotation[]
public <A extends Annotation> A
public Class<T>[]
public Class<T>
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> annotation, Field field, 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> annotation, Method method, 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, Class<T> 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(Class<T> 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, Field field)

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

packageCacheback to summary
private final Map<Class<? extends Annotation>, Map<Package, Annotation>> packageCache

Cache for package-level annotations.

Constructor Detail

RuntimeInlineAnnotationReaderback to summary
public RuntimeInlineAnnotationReader()

Default constructor.

Method Detail

fullNameback to summary
protected String fullName(Method 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
getAllFieldAnnotationsback to summary
public Annotation[] getAllFieldAnnotations(Field 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(Method 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, Class<T> 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 Class<T>[] 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 Class<T> 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> annotation, Field field, 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> annotation, Method 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> annotation, Method method, 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, Class<T> 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(Class<T> 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, Field field)

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> annotation, Method method)

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

Annotations
@Override