Package hec.lang.annotation
Class EntityBeanAdapter<T1,T2>
java.lang.Object
hec.lang.annotation.EntityBeanAdapter<T1,T2>
An adapter that maps an annotated entity object to a bean.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeanToEntity
(T2 beanInstance) Generates the entity object from the bean object.protected String
buildMethodName
(String attributeName, String prefix) protected void
callBeanSetterMethod
(Object entityMethodReturnValue, Class<?> entityType, String beanAttributeName, T2 beanInstance) protected void
callEntitySetterMethod
(T1 entityInstance, String entityAttributeName, Object beanValue, Class<?> beanType) entityToBean
(T1 entityInstance) Converts the annotated entity object to the bean object.getBeanAttributeClass
(String beanAttributeName) protected Method
getBeanMethod
(Object parameterValue, Class parameterClass, String attributeName) protected Method
getEntityGetterMethod
(String entityGetterMethodName) protected EntityBeanAdapter
getInstance
(String domain, Class<?> innerEntityClass, Class<? extends Object> beanValueClass)
-
Constructor Details
-
EntityBeanAdapter
-
-
Method Details
-
entityToBean
Converts the annotated entity object to the bean object.- Throws:
EntityBeanAdapterException
-
beanToEntity
Generates the entity object from the bean object.- Parameters:
beanInstance
-- Returns:
- Throws:
EntityBeanAdapterException
-
callEntitySetterMethod
protected void callEntitySetterMethod(T1 entityInstance, String entityAttributeName, Object beanValue, Class<?> beanType) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException -
getInstance
protected EntityBeanAdapter getInstance(String domain, Class<?> innerEntityClass, Class<? extends Object> beanValueClass) -
getEntityGetterMethod
- Throws:
NoSuchMethodException
-
getBeanMethod
protected Method getBeanMethod(Object parameterValue, Class parameterClass, String attributeName) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
getBeanAttributeClass
protected Class<? extends Object> getBeanAttributeClass(String beanAttributeName) throws NoSuchMethodException - Throws:
NoSuchMethodException
-
callBeanSetterMethod
protected void callBeanSetterMethod(Object entityMethodReturnValue, Class<?> entityType, String beanAttributeName, T2 beanInstance) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException -
buildMethodName
-