Package org.cyclos.impl.utils.conversion
Class ObjectConverter<T>
- java.lang.Object
-
- org.cyclos.impl.utils.conversion.AbstractBeanConverter<T>
-
- org.cyclos.impl.utils.conversion.ObjectConverter<T>
-
- All Implemented Interfaces:
BeanConverter<T>
- Direct Known Subclasses:
AccountBalanceLimitVOConverter,AccountPaymentAmountLimitVOConverter,AgreementContentVOConverter,BaseAccountLimitDTOConverter,BaseCustomFieldValueModelConverter,BaseEntityConverter,BasicAdDTOConverter,ChannelConfigurationDTOConverter,ConnectedUserVOConverter,CountryVOConverter,CurrencyVOWithDRateConverter,CustomFieldDTOConverter,EntityVOConverter,LocaleConverter,LocaleVOConverter,OperatorDTOConverter,PhoneDTOConverter,ProductProfileFieldDTOConverter,ReceiptPartVOConverter,ReceiptVOConverter,RecordDTOConverter,TimeZoneVOConverter,UserFormatConfigurationDTOConverter
@Component public class ObjectConverter<T> extends AbstractBeanConverter<T>
Generic implementation forBeanConverter- instantiates the destination type and fills in the properties usingConversionHandler#fill(Object, Object, String...)
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.utils.conversion.AbstractBeanConverter
beanHandler, configurationHandler, conversionHandler, entityManagerHandler, profileFieldHandler
-
-
Constructor Summary
Constructors Constructor Description ObjectConverter()ObjectConverter(Class<T> beanType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tconvert(Class<T> toType, Object source, Object[] excludingProperties, InvocationContext.ConversionContext context)Applies the following logic: The resulting bean is instantiated with#instantiate(Class, Object), then properties are copied from the source object with#instantiate(Class, Object)protected voidfill(Object source, T result, Object[] excludingProperties, InvocationContext.ConversionContext context)Copy properties from the source to the destination objectprotected SessionDatagetSessionData()protected Tinstantiate(Class<T> beanType, Object source, InvocationContext.ConversionContext context)Instantiate the result object from the given source object.protected voidregisterMapping(Class<?> sourceType, Class<?> destinationType)May be used by subclasses to register a mappingprotected Class<T>resolveDestinationType(Class<T> toType, Object source, InvocationContext.ConversionContext context)-
Methods inherited from class org.cyclos.impl.utils.conversion.AbstractBeanConverter
canBeUsedAsSourceForFilling, getApplicationContext, getBeanType, getFormatter
-
-
-
-
Method Detail
-
convert
public T convert(Class<T> toType, Object source, Object[] excludingProperties, InvocationContext.ConversionContext context)
Applies the following logic: The resulting bean is instantiated with#instantiate(Class, Object), then properties are copied from the source object with#instantiate(Class, Object)
-
fill
protected void fill(Object source, T result, Object[] excludingProperties, InvocationContext.ConversionContext context)
Copy properties from the source to the destination object
-
getSessionData
protected SessionData getSessionData()
- Overrides:
getSessionDatain classAbstractBeanConverter<T>
-
instantiate
protected T instantiate(Class<T> beanType, Object source, InvocationContext.ConversionContext context)
Instantiate the result object from the given source object. By default, just invoke the default constructor on the bean type
-
registerMapping
protected void registerMapping(Class<?> sourceType, Class<?> destinationType)
May be used by subclasses to register a mapping
-
-