private static class DataObjectFactory.DtoInvocationHandler extends java.lang.Object implements java.lang.reflect.InvocationHandler, PropertiesDescriptor
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Object |
delegate
The DMO which will handle unimplemented calls of the proxy object.
|
private java.lang.Class<?> |
dtoClass
The class representing abstract DTO class
|
private java.lang.Object |
dtoObject
The object created from DTO abstract class and DMO instance
|
| Constructor and Description |
|---|
DtoInvocationHandler(java.lang.Object delegate,
java.lang.Class<?> dtoClass)
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getPropertyValues()
Get all the properties of this compound object by collecting all properties of the nested object,
an instance of dmo interface and the created proxy object, an instance of the dto abstract class.
|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Processes a method invocation on a proxy instance and returns the result.
|
private static void |
setProperties(java.util.Map<java.lang.String,java.lang.Object> valuesMap,
java.lang.Object obj,
java.lang.Class<?> objClass)
Fills the given properties map by expecting the target object properties implemented by the given type.
|
void |
setProxiedObject(java.lang.Object dtoObject)
Set the reference to the object created from DTO abstract class and DMO instance
|
private final java.lang.Object delegate
private final java.lang.Class<?> dtoClass
private java.lang.Object dtoObject
public DtoInvocationHandler(java.lang.Object delegate,
java.lang.Class<?> dtoClass)
delegate - The delegate DMO.dtoClass - The object created from DTO abstract class and DMO instancepublic java.lang.Object invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Throwable
invoke in interface java.lang.reflect.InvocationHandlerproxy - the proxy instance that the method was invoked on.method - the Method instance corresponding to the interface method invoked on the proxy instance. The
proxy is constructed so that this method should be relayed to the delegate instead.args - an array of objects containing the values of the arguments passed in the method invocation
on the proxy instance, or null if interface method takes no arguments.java.lang.Throwable - the exception to throw from the method invocation on the DMO instance.public java.util.Map<java.lang.String,java.lang.Object> getPropertyValues()
getPropertyValues in interface PropertiesDescriptorpublic void setProxiedObject(java.lang.Object dtoObject)
dtoObject - The object created from DTO abstract class and DMO instanceprivate static void setProperties(java.util.Map<java.lang.String,java.lang.Object> valuesMap,
java.lang.Object obj,
java.lang.Class<?> objClass)
valuesMap - The given properties mapobj - The target objectobjClass - The given type