public class AnnotationInstanceProvider extends Object
Provides dynamic annotation creation. If you know the type of the annotation
instance to create at development time you should use
AnnotationLiteral
instead of AnnotationInstanceProvider
.
AnnotationInstanceProvider
creates a proxy, and will return values as
provided when the annotation instance was created. An
AnnotationInstanceProvider
will cache generated proxy classes.
AnnotationLiteral
Constructor and Description |
---|
AnnotationInstanceProvider() |
Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
get(Class<T> annotationType,
Map<String,?> values)
Returns an instance of the given annotation type with attribute values
specified in the map.
|
public <T extends Annotation> T get(Class<T> annotationType, Map<String,?> values)
Returns an instance of the given annotation type with attribute values specified in the map.
Annotation
, array and enum types the values must exactly match
the declared return type of the attribute or a ClassCastException
will result.Character
or String
.Number
.If am member does not have a corresponding entry in the value map then the annotations default value will be used.
If the annotation member does not have a default value then a NullMemberException will be thrown
annotationType
- the type of the annotation instance to generatevalues
- the attribute values of this annotationCopyright © 2012 Seam Framework. All Rights Reserved.