Top Description Methods
org.glassfish.jaxb.core.v2.model.annotation

public Interface AnnotationSource

Known Direct Subinterfaces
org.glassfish.jaxb.core.v2.model.core.PropertyInfo, org.glassfish.jaxb.runtime.v2.model.impl.PropertySeed
Known Direct Implementers
org.glassfish.jaxb.runtime.v2.model.impl.ElementInfoImpl.PropertyImpl
Imports
java.lang.annotation.Annotation

Implemented by objects that can have annotations.
Author
Kohsuke Kawaguchi

Method Summary

Modifier and TypeMethod and Description
public boolean
hasAnnotation(Class<? extends Annotation> annotationType)

Returns true if the property has the specified annotation.

public <A extends Annotation> A

Returns:

null if the annotation is not present.
readAnnotation
(Class<A> annotationType)

Gets the value of the specified annotation from the given property.

Method Detail

hasAnnotationback to summary
public boolean hasAnnotation(Class<? extends Annotation> annotationType)

Returns true if the property has the specified annotation.

Short for readAnnotation(annotationType)!=null, but this method is typically faster.

readAnnotationback to summary
public <A extends Annotation> A readAnnotation(Class<A> annotationType)

Gets the value of the specified annotation from the given property.

When this method is used for a property that consists of a getter and setter, it returns the annotation on either of those methods. If both methods have the same annotation, it is an error.

Returns:A

null if the annotation is not present.