public class AnnotationDescriptor<T extends Annotation> extends Object
Annotation
instance
and the values of its elements.
The "elements" we're talking about are the annotation attributes,
not its targets (the term "element" is used ambiguously
in Java's annotations documentation).Constructor and Description |
---|
AnnotationDescriptor(Class<T> annotationType) |
AnnotationDescriptor(Class<T> annotationType,
Map<String,Object> elements) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsElement(String elementName) |
Map<String,Object> |
getElements()
Returns a map with the elements contained in this descriptor keyed by name.
|
static <S extends Annotation> |
getInstance(Class<S> annotationType)
Returns a new descriptor for the given annotation type.
|
static <S extends Annotation> |
getInstance(Class<S> annotationType,
Map<String,Object> elements)
Returns a new descriptor for the given annotation type.
|
int |
numberOfElements() |
void |
setValue(String elementName,
Object value) |
Class<T> |
type() |
Object |
valueOf(String elementName) |
public static <S extends Annotation> AnnotationDescriptor<S> getInstance(Class<S> annotationType)
S
- The type of the annotation.annotationType
- The annotation's class.public static <S extends Annotation> AnnotationDescriptor<S> getInstance(Class<S> annotationType, Map<String,Object> elements)
S
- The type of the annotation.annotationType
- The annotation's class.elements
- A map with attribute values for the annotation to be created.public boolean containsElement(String elementName)
public int numberOfElements()
public Map<String,Object> getElements()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.