|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.solder.reflection.AnnotationInstanceProvider
public class AnnotationInstanceProvider
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 Summary | |
---|---|
AnnotationInstanceProvider()
|
Method Summary | ||
---|---|---|
|
get(Class<T> annotationType,
Map<String,?> values)
Returns an instance of the given annotation type with attribute values specified in the map. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationInstanceProvider()
Method Detail |
---|
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 annotation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |