public abstract class DozerConverter<A,B> extends Object implements ConfigurableCustomConverter
Constructor and Description |
---|
DozerConverter(Class<A> prototypeA,
Class<B> prototypeB)
Defines two types, which will take part transformation.
|
Modifier and Type | Method and Description |
---|---|
Object |
convert(Object existingDestinationFieldValue,
Object sourceFieldValue,
Class<?> destinationClass,
Class<?> sourceClass) |
A |
convertFrom(B source)
Converts the source field to the destination field and return the resulting destination
value
|
abstract A |
convertFrom(B source,
A destination)
Converts the source field to the destination field and return the resulting destination
value
|
B |
convertTo(A source)
Converts the source field to the destination field and return the resulting destination
value.
|
abstract B |
convertTo(A source,
B destination)
Converts the source field to the destination field and return the resulting destination
value.
|
String |
getParameter()
Retrieves the static parameter configured for this particular converter instance.
|
void |
setParameter(String parameter)
Sets the configured parameter value for this converter instance.
|
public DozerConverter(Class<A> prototypeA, Class<B> prototypeB)
prototypeA
- type oneprototypeB
- type twopublic Object convert(Object existingDestinationFieldValue, Object sourceFieldValue, Class<?> destinationClass, Class<?> sourceClass)
convert
in interface CustomConverter
public abstract B convertTo(A source, B destination)
source
- the value of the source fielddestination
- the current value of the desitinatino field (or null)public B convertTo(A source)
source
- the value of the source fieldpublic abstract A convertFrom(B source, A destination)
source
- the value of the source fielddestination
- the current value of the desitinatino field (or null)public A convertFrom(B source)
source
- the value of the source fieldpublic void setParameter(String parameter)
setParameter
in interface ConfigurableCustomConverter
parameter
- configured parameter valuepublic String getParameter()
IllegalStateException
- if parameter has not been set yet.Copyright © 2005-2014 dozer. All Rights Reserved.