|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dozer.DozerBeanMapper
public class DozerBeanMapper
Public Dozer Mapper implementation. This should be used/defined as a singleton within your application. This class perfoms several one time initializations and loads the custom xml mappings, so you will not want to create many instances of it for performance reasons. Typically a system will only have one DozerBeanMapper instance per VM. If you are using an IOC framework (i.e Spring), define the Mapper as singleton="true". If you are not using an IOC framework, a DozerBeanMapperSingletonWrapper convenience class has been provided in the Dozer jar.
It is technically possible to have multiple DozerBeanMapper instances initialized, but it will hinder internal performance optimizations such as caching.
| Constructor Summary | |
|---|---|
DozerBeanMapper()
|
|
DozerBeanMapper(List<String> mappingFiles)
|
|
| Method Summary | ||
|---|---|---|
void |
addMapping(BeanMappingBuilder mappingBuilder)
|
|
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 |
|
protected Mapper |
getMappingProcessor()
|
|
|
map(Object source,
Class<T> destinationClass)
Constructs new instance of destinationClass and performs mapping between from source |
|
|
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. |
|
void |
setMappings(List<? extends BeanMappingBuilder> mappingBuilder)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DozerBeanMapper()
public DozerBeanMapper(List<String> mappingFiles)
| Method Detail |
|---|
public void map(Object source,
Object destination,
String mapId)
throws MappingException
map in interface MapperMappingException
public <T> T map(Object source,
Class<T> destinationClass,
String mapId)
throws MappingException
map in interface MapperMappingException
public <T> T map(Object source,
Class<T> destinationClass)
throws MappingException
map in interface MapperMappingException
public void map(Object source,
Object destination)
throws MappingException
map in interface MapperMappingExceptionpublic List<String> getMappingFiles()
public void setMappingFiles(List<String> mappingFileUrls)
mappingFileUrls - URLs referencing custom mapping filesURLpublic 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 setMappings(List<? extends BeanMappingBuilder> mappingBuilder)
public void addMapping(BeanMappingBuilder mappingBuilder)
public List<? extends DozerEventListener> getEventListeners()
public void setEventListeners(List<? extends DozerEventListener> eventListeners)
public CustomFieldMapper getCustomFieldMapper()
public void setCustomFieldMapper(CustomFieldMapper customFieldMapper)
public void setCustomConvertersWithId(Map<String,CustomConverter> customConvertersWithId)
customConvertersWithId - converter id to converter instance map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||