Package org.intermine.util
Class DynamicBean
- java.lang.Object
-
- org.intermine.util.DynamicBean
-
- All Implemented Interfaces:
net.sf.cglib.proxy.Callback
,net.sf.cglib.proxy.MethodInterceptor
public class DynamicBean extends java.lang.Object implements net.sf.cglib.proxy.MethodInterceptor
Class which represents a generic bean- Author:
- Andrew Varley
-
-
Constructor Summary
Constructors Constructor Description DynamicBean()
Construct the interceptor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FastPathObject
create(java.lang.Class<? extends FastPathObject> clazz, java.lang.Class<?>[] inter)
Create a DynamicBeanjava.util.Map<java.lang.String,java.lang.Object>
getMap()
Getter for the map, for testing purposesjava.lang.Object
intercept(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, net.sf.cglib.proxy.MethodProxy proxy)
Intercept all method calls, and operate on Map.
-
-
-
Method Detail
-
create
public static FastPathObject create(java.lang.Class<? extends FastPathObject> clazz, java.lang.Class<?>[] inter)
Create a DynamicBean- Parameters:
clazz
- the class to extendinter
- the interfaces to implement- Returns:
- the DynamicBean
-
intercept
public java.lang.Object intercept(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] args, net.sf.cglib.proxy.MethodProxy proxy) throws java.lang.Throwable
Intercept all method calls, and operate on Map. Note that final methods (eg. getClass) cannot be intercepted- Specified by:
intercept
in interfacenet.sf.cglib.proxy.MethodInterceptor
- Parameters:
obj
- the proxymethod
- the method calledargs
- the parametersproxy
- the method proxy- Returns:
- the return value of the real method call
- Throws:
java.lang.Throwable
- if an error occurs in executing the real method
-
getMap
public java.util.Map<java.lang.String,java.lang.Object> getMap()
Getter for the map, for testing purposes- Returns:
- a map of data for this object
-
-