TorqueBox 3.1.2

org.torquebox.core.injection
Class AnnotationInstanceProvider

java.lang.Object
  extended by org.torquebox.core.injection.AnnotationInstanceProvider

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.

Author:
Stuart Douglas, Pete Muir
See Also:
AnnotationLiteral

Constructor Summary
AnnotationInstanceProvider()
           
 
Method Summary
<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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationInstanceProvider

public AnnotationInstanceProvider()
Method Detail

get

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.

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

Parameters:
annotationType - the type of the annotation instance to generate
values - the attribute values of this annotation

TorqueBox 3.1.2

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.