org.apache.beehive.controls.runtime.bean
Class PropertySetProxy<T extends Annotation>
Object
PropertySetProxy<T>
- All Implemented Interfaces:
- InvocationHandler
public class PropertySetProxy<T extends Annotation>
- extends Object
- implements InvocationHandler
The PropertySetProxy class is a dynamic proxy InvocationHandler class that exposes the
values held within a PropertyMap as an Object implementing an annotation type interface.
This enables properties resolved using the PropertyMap's hiearchical resolution mechanism to
be exposed to the client of the proxy in the same way that JSR-175 annotations are
exposed using raw Java reflection APIs. A proxy of this type should behave identically
to the one returned from a call to AnnotatedElement.getAnnotation()
, but backed
by a richer, more dynamic resolution mechanism.
- See Also:
Proxy
,
InvocationHandler
,
AnnotatedElement.getAnnotation(java.lang.Class)
,
PropertySet
,
PropertyMap
Method Summary |
static
|
getProxy(Class<T> propertySet,
PropertyMap propertyMap)
Creates a new proxy instance implementing the PropertySet interface and backed
by the data from the property map. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
|
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getProxy
public static <T extends Annotation> T getProxy(Class<T> propertySet,
PropertyMap propertyMap)
- Creates a new proxy instance implementing the PropertySet interface and backed
by the data from the property map.
- Parameters:
propertySet
- an annotation type that has the PropertySet meta-annotationpropertyMap
- the PropertyMap containing property values backing the proxy
- Returns:
- proxy that implements the PropertySet interface
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Specified by:
invoke
in interface InvocationHandler
- Throws:
Throwable