|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ferri.core.vo.commons.converters.AbstractConverter<DTO,VO>
public abstract class AbstractConverter<DTO extends BaseDTO,VO extends BaseVO>
Field Summary | |
---|---|
private BeansConverter |
beansConverter
|
private Class<DTO> |
classTypeDTO
|
private Class<VO> |
classTypeVO
|
protected Class<? extends AbstractConverter> |
clazz
The Class instance of this DispatchAction class. |
private static String |
CONVERT_DTO_2_VO
|
private org.apache.log4j.Logger |
logger
|
private HashMap<String,Method> |
methods
The set of Method objects we have introspected for this class, keyed by method name. |
Constructor Summary | |
---|---|
AbstractConverter()
|
Method Summary | |
---|---|
Collection<VO> |
convertCollectionDTO2VO(Collection<BaseDTO> colDTO)
|
Collection<VO> |
convertCollectionDTO2VO(Collection<BaseDTO> colDTO,
String methodName)
|
Collection<DTO> |
convertCollectionVO2DTO(Collection<BaseVO> colVO)
|
Collection<DTO> |
convertCollectionVO2DTO(Collection<BaseVO> colVO,
String methodName)
|
abstract VO |
convertDTO2VO(DTO dto)
Convert instance DTO to instance VO |
abstract DTO |
convertVO2DTO(VO vo)
Convert instance VO to instance DTO |
void |
deregisterInConverters(Map<Class<?>,AbstractConverter<? extends BaseDTO,? extends BaseVO>> converters)
|
private AbstractBase |
executeMethod(AbstractBase abstractBase,
String baseMethodName,
String methodName)
|
BeansConverter |
getBeansConverter()
|
Class<DTO> |
getClassTypeDTO()
|
Class<VO> |
getClassTypeVO()
|
protected org.apache.log4j.Logger |
getLogger()
|
protected Method |
getMethod(String name,
Class<?> arg)
Introspect the current class to identify a method of the specified name that accepts the same parameter types as the execute method does. |
private String |
getMethodPattern(String prefix,
String methodName)
|
void |
initialize()
Execute the first operations to complete the instanciation. |
private void |
initiateObjectsType()
Initialize casters objects |
(package private) VO |
internalWarpDTO2VO(BaseDTO baseDTO)
|
(package private) VO |
internalWarpDTO2VO(BaseDTO baseDTO,
String methodName)
|
(package private) DTO |
internalWarpVO2DTO(BaseVO baseVO)
|
(package private) DTO |
internalWarpVO2DTO(BaseVO baseVO,
String methodName)
|
void |
registerInConverters(Map<Class<?>,AbstractConverter<? extends BaseDTO,? extends BaseVO>> converters)
|
void |
setBeansConverter(BeansConverter beansConverter)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String CONVERT_DTO_2_VO
private org.apache.log4j.Logger logger
protected Class<? extends AbstractConverter> clazz
DispatchAction
class.
private HashMap<String,Method> methods
private BeansConverter beansConverter
private Class<DTO extends BaseDTO> classTypeDTO
private Class<VO extends BaseVO> classTypeVO
Constructor Detail |
---|
public AbstractConverter()
Method Detail |
---|
public abstract VO convertDTO2VO(DTO dto)
dto
- DTO
public abstract DTO convertVO2DTO(VO vo)
vo
- VO
public final Class<DTO> getClassTypeDTO()
public final Class<VO> getClassTypeVO()
VO internalWarpDTO2VO(BaseDTO baseDTO)
VO internalWarpDTO2VO(BaseDTO baseDTO, String methodName) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException
InvocationTargetException
NoSuchMethodException
IllegalAccessException
DTO internalWarpVO2DTO(BaseVO baseVO)
DTO internalWarpVO2DTO(BaseVO baseVO, String methodName) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException
InvocationTargetException
NoSuchMethodException
IllegalAccessException
public Collection<VO> convertCollectionDTO2VO(Collection<BaseDTO> colDTO)
public Collection<VO> convertCollectionDTO2VO(Collection<BaseDTO> colDTO, String methodName) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException
InvocationTargetException
NoSuchMethodException
IllegalAccessException
public Collection<DTO> convertCollectionVO2DTO(Collection<BaseVO> colVO)
public Collection<DTO> convertCollectionVO2DTO(Collection<BaseVO> colVO, String methodName) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException
InvocationTargetException
NoSuchMethodException
IllegalAccessException
public void registerInConverters(Map<Class<?>,AbstractConverter<? extends BaseDTO,? extends BaseVO>> converters)
public void deregisterInConverters(Map<Class<?>,AbstractConverter<? extends BaseDTO,? extends BaseVO>> converters)
private AbstractBase executeMethod(AbstractBase abstractBase, String baseMethodName, String methodName) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException
abstractBase
- baseMethodName
- methodName
-
InvocationTargetException
NoSuchMethodException
IllegalAccessException
public void initialize() throws GenericClassNotFound, GenericTypeNotFound
Initializable
initialize
in interface Initializable
GenericClassNotFound
- if the given class dont have the expected parent class
GenericTypeNotFound
- if the given type is not foundInitializable.initialize()
private void initiateObjectsType() throws GenericClassNotFound, GenericTypeNotFound
GenericClassNotFound
- if the given class dont have the expected parent class
GenericTypeNotFound
- if the given type is not foundprotected Method getMethod(String name, Class<?> arg) throws NoSuchMethodException
execute
method does.
name
- Name of the method to be introspectedarg
-
NoSuchMethodException
- if no such method can be foundprivate String getMethodPattern(String prefix, String methodName)
public BeansConverter getBeansConverter()
public void setBeansConverter(BeansConverter beansConverter)
beansConverter
- the beansConverter to setprotected org.apache.log4j.Logger getLogger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |