public class DozerBeanMapper extends Object implements Mapper
Constructor and Description |
---|
DozerBeanMapper() |
DozerBeanMapper(List<String> mappingFiles) |
Modifier and Type | Method and Description |
---|---|
void |
addMapping(BeanMappingBuilder mappingBuilder)
Adds API mapping to given mapper instance.
|
void |
addMapping(InputStream xmlStream)
Add mapping XML from InputStream resources for mapping not stored in
files (e.g.
|
void |
destroy() |
List<CustomConverter> |
getCustomConverters() |
Map<String,CustomConverter> |
getCustomConvertersWithId() |
CustomFieldMapper |
getCustomFieldMapper() |
List<? extends DozerEventListener> |
getEventListeners() |
List<String> |
getMappingFiles()
Returns list of provided mapping file URLs
|
MappingMetadata |
getMappingMetadata()
The
MappingMetadata interface can be used to query information about the current
mapping definitions. |
protected Mapper |
getMappingProcessor() |
<T> T |
map(Object source,
Class<T> destinationClass)
Constructs new instance of destinationClass and performs mapping between from source
|
<T> T |
map(Object source,
Class<T> destinationClass,
String mapId)
Constructs new instance of destinationClass and performs mapping between from source
|
void |
map(Object source,
Object destination)
Performs mapping between source and destination objects
|
void |
map(Object source,
Object destination,
String mapId)
Performs mapping between source and destination objects
|
void |
setCustomConverters(List<CustomConverter> customConverters) |
void |
setCustomConvertersWithId(Map<String,CustomConverter> customConvertersWithId)
Converters passed with this method could be further referenced in mappings via its unique id.
|
void |
setCustomFieldMapper(CustomFieldMapper customFieldMapper) |
void |
setEventListeners(List<? extends DozerEventListener> eventListeners) |
void |
setFactories(Map<String,BeanFactory> factories) |
void |
setMappingFiles(List<String> mappingFileUrls)
Sets list of URLs for custom XML mapping files, which are loaded when mapper gets initialized.
|
public void map(Object source, Object destination, String mapId) throws MappingException
map
in interface Mapper
MappingException
public <T> T map(Object source, Class<T> destinationClass, String mapId) throws MappingException
map
in interface Mapper
MappingException
public <T> T map(Object source, Class<T> destinationClass) throws MappingException
map
in interface Mapper
MappingException
public void map(Object source, Object destination) throws MappingException
map
in interface Mapper
MappingException
public List<String> getMappingFiles()
public void setMappingFiles(List<String> mappingFileUrls)
mappingFileUrls
- URLs referencing custom mapping filesURL
public void setFactories(Map<String,BeanFactory> factories)
public void setCustomConverters(List<CustomConverter> customConverters)
public List<CustomConverter> getCustomConverters()
public Map<String,CustomConverter> getCustomConvertersWithId()
public void destroy()
protected Mapper getMappingProcessor()
public void addMapping(InputStream xmlStream)
xmlStream
- Dozer mapping XML InputStreampublic void addMapping(BeanMappingBuilder mappingBuilder)
mappingBuilder
- mappings to be addedpublic List<? extends DozerEventListener> getEventListeners()
public void setEventListeners(List<? extends DozerEventListener> eventListeners)
public CustomFieldMapper getCustomFieldMapper()
public void setCustomFieldMapper(CustomFieldMapper customFieldMapper)
public MappingMetadata getMappingMetadata()
MappingMetadata
interface can be used to query information about the current
mapping definitions. It provides read only access to all important classes and field
mapping properties. When first called, initializes all mappings if map() has not yet been called.public void setCustomConvertersWithId(Map<String,CustomConverter> customConvertersWithId)
customConvertersWithId
- converter id to converter instance mapCopyright © 2005-2014 dozer. All Rights Reserved.