public abstract class AbstractMapper<S,T> extends Object implements Mapper<S,T>
| Constructor and Description |
|---|
AbstractMapper(Instantiator<S,T> instantiator,
MappingContextFactory<S> mappingContextFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendToStringBuilder(StringBuilder sb) |
T |
map(S source)
map source object to a new instance of T
|
T |
map(S source,
MappingContext<S> mappingContext) |
protected abstract void |
mapFields(S source,
T target,
MappingContext<S> mappingContext) |
void |
mapTo(S source,
T target,
MappingContext<S> mappingContext)
map source object to target object.
|
protected abstract void |
mapToFields(S source,
T target,
MappingContext<S> mappingContext) |
MappingContext<S> |
newMappingContext(S source) |
public AbstractMapper(Instantiator<S,T> instantiator, MappingContextFactory<S> mappingContextFactory)
public final T map(S source) throws MappingException
Mappermap in interface Mapper<S,T>source - object to map fromMappingException - if an exception occurspublic final T map(S source, MappingContext<S> mappingContext) throws MappingException
map in interface Mapper<S,T>MappingExceptionpublic final void mapTo(S source, T target, MappingContext<S> mappingContext) throws MappingException
FieldMappermapTo in interface FieldMapper<S,T>source - object to map fromtarget - object to map tomappingContext - the mapping contextMappingExceptionpublic final MappingContext<S> newMappingContext(S source)
newMappingContext in interface Mapper<S,T>protected abstract void mapFields(S source, T target, MappingContext<S> mappingContext) throws Exception
Exceptionprotected abstract void mapToFields(S source, T target, MappingContext<S> mappingContext) throws Exception
Exceptionprotected void appendToStringBuilder(StringBuilder sb)
Copyright © 2015. All rights reserved.