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 StringbuildMethodName(String attributeName, String prefix) protected voidcallBeanSetterMethod(Object entityMethodReturnValue, Class<?> entityType, String beanAttributeName, T2 beanInstance) protected voidcallEntitySetterMethod(T1 entityInstance, String entityAttributeName, Object beanValue, Class<?> beanType) entityToBean(T1 entityInstance) Converts the annotated entity object to the bean object.getBeanAttributeClass(String beanAttributeName) protected MethodgetBeanMethod(Object parameterValue, Class parameterClass, String attributeName) protected MethodgetEntityGetterMethod(String entityGetterMethodName) protected EntityBeanAdaptergetInstance(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
-