com.sun.xml.bind.v2.model.annotation
Class RuntimeInlineAnnotationReader

java.lang.Object
  extended by com.sun.xml.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl<Type,Class,Field,Method>
      extended by com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader
All Implemented Interfaces:
AnnotationReader<Type,Class,Field,Method>, RuntimeAnnotationReader

public final class RuntimeInlineAnnotationReader
extends AbstractInlineAnnotationReaderImpl<Type,Class,Field,Method>
implements RuntimeAnnotationReader

AnnotationReader that uses java.lang.reflect to read annotations from class files.

Author:
Kohsuke Kawaguchi (kk@kohsuke.org)

Constructor Summary
RuntimeInlineAnnotationReader()
           
 
Method Summary
protected  String fullName(Method m)
          Gets the fully-qualified name of the method.
 Annotation[] getAllFieldAnnotations(Field field, Locatable srcPos)
           
 Annotation[] getAllMethodAnnotations(Method method, Locatable srcPos)
           
<A extends Annotation>
A
getClassAnnotation(Class<A> a, Class clazz, Locatable srcPos)
           
 Class[] getClassArrayValue(Annotation a, String name)
           
 Class getClassValue(Annotation a, String name)
           
<A extends Annotation>
A
getFieldAnnotation(Class<A> annotation, Field field, Locatable srcPos)
           
<A extends Annotation>
A
getMethodAnnotation(Class<A> annotation, Method method, Locatable srcPos)
           
<A extends Annotation>
A
getMethodParameterAnnotation(Class<A> annotation, Method method, int paramIndex, Locatable srcPos)
           
<A extends Annotation>
A
getPackageAnnotation(Class<A> a, Class clazz, Locatable srcPos)
           
 boolean hasClassAnnotation(Class clazz, Class<? extends Annotation> annotationType)
           
 boolean hasFieldAnnotation(Class<? extends Annotation> annotationType, Field field)
           
 boolean hasMethodAnnotation(Class<? extends Annotation> annotation, Method method)
           
 
Methods inherited from class com.sun.xml.bind.v2.model.annotation.AbstractInlineAnnotationReaderImpl
getErrorHandler, getMethodAnnotation, hasMethodAnnotation, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.xml.bind.v2.model.annotation.AnnotationReader
getMethodAnnotation, hasMethodAnnotation, setErrorHandler
 

Constructor Detail

RuntimeInlineAnnotationReader

public RuntimeInlineAnnotationReader()
Method Detail

getFieldAnnotation

public <A extends Annotation> A getFieldAnnotation(Class<A> annotation,
                                                   Field field,
                                                   Locatable srcPos)
Specified by:
getFieldAnnotation in interface AnnotationReader<Type,Class,Field,Method>

hasFieldAnnotation

public boolean hasFieldAnnotation(Class<? extends Annotation> annotationType,
                                  Field field)
Specified by:
hasFieldAnnotation in interface AnnotationReader<Type,Class,Field,Method>

hasClassAnnotation

public boolean hasClassAnnotation(Class clazz,
                                  Class<? extends Annotation> annotationType)
Specified by:
hasClassAnnotation in interface AnnotationReader<Type,Class,Field,Method>

getAllFieldAnnotations

public Annotation[] getAllFieldAnnotations(Field field,
                                           Locatable srcPos)
Specified by:
getAllFieldAnnotations in interface AnnotationReader<Type,Class,Field,Method>

getMethodAnnotation

public <A extends Annotation> A getMethodAnnotation(Class<A> annotation,
                                                    Method method,
                                                    Locatable srcPos)
Specified by:
getMethodAnnotation in interface AnnotationReader<Type,Class,Field,Method>

hasMethodAnnotation

public boolean hasMethodAnnotation(Class<? extends Annotation> annotation,
                                   Method method)
Specified by:
hasMethodAnnotation in interface AnnotationReader<Type,Class,Field,Method>

getAllMethodAnnotations

public Annotation[] getAllMethodAnnotations(Method method,
                                            Locatable srcPos)
Specified by:
getAllMethodAnnotations in interface AnnotationReader<Type,Class,Field,Method>

getMethodParameterAnnotation

public <A extends Annotation> A getMethodParameterAnnotation(Class<A> annotation,
                                                             Method method,
                                                             int paramIndex,
                                                             Locatable srcPos)
Specified by:
getMethodParameterAnnotation in interface AnnotationReader<Type,Class,Field,Method>

getClassAnnotation

public <A extends Annotation> A getClassAnnotation(Class<A> a,
                                                   Class clazz,
                                                   Locatable srcPos)
Specified by:
getClassAnnotation in interface AnnotationReader<Type,Class,Field,Method>

getPackageAnnotation

public <A extends Annotation> A getPackageAnnotation(Class<A> a,
                                                     Class clazz,
                                                     Locatable srcPos)
Specified by:
getPackageAnnotation in interface AnnotationReader<Type,Class,Field,Method>

getClassValue

public Class getClassValue(Annotation a,
                           String name)
Specified by:
getClassValue in interface AnnotationReader<Type,Class,Field,Method>

getClassArrayValue

public Class[] getClassArrayValue(Annotation a,
                                  String name)
Specified by:
getClassArrayValue in interface AnnotationReader<Type,Class,Field,Method>

fullName

protected String fullName(Method m)
Description copied from class: AbstractInlineAnnotationReaderImpl
Gets the fully-qualified name of the method. Used for error messages.

Specified by:
fullName in class AbstractInlineAnnotationReaderImpl<Type,Class,Field,Method>


Copyright © 2014 Oracle Corporation. All Rights Reserved.