org.apache.camel.converter.dozer
Class DozerTypeConverterLoader

java.lang.Object
  extended by org.apache.camel.converter.dozer.DozerTypeConverterLoader
All Implemented Interfaces:
org.apache.camel.CamelContextAware

public class DozerTypeConverterLoader
extends Object
implements org.apache.camel.CamelContextAware

DozerTypeConverterLoader provides the mechanism for registering a Dozer Mapper as TypeConverter for a CamelContext.

While a mapper can be explicitly supplied as a parameter the CamelContext's registry will also be searched for Mapper instances. A DozerTypeConverter is created to wrap each Mapper instance and the mapper is queried for the types it converts. The queried types are used to register the TypeConverter with the context via its TypeConverterRegistry.


Constructor Summary
DozerTypeConverterLoader()
          Creates a DozerTypeConverter performing no TypeConverter registration.
DozerTypeConverterLoader(org.apache.camel.CamelContext camelContext)
          Creates a DozerTypeConverter that will search the given CamelContext for instances of DozerBeanMapper.
DozerTypeConverterLoader(org.apache.camel.CamelContext camelContext, org.dozer.DozerBeanMapper mapper)
          Creates a DozerTypeConverter that will wrap the the given DozerBeanMapper as a DozerTypeConverter and register it with the given context.
 
Method Summary
 void addMapping(org.dozer.loader.api.BeanMappingBuilder beanMappingBuilder)
          Registers Dozer BeanMappingBuilder in current mapper instance.
 org.apache.camel.CamelContext getCamelContext()
           
 void init(org.apache.camel.CamelContext camelContext, org.dozer.DozerBeanMapper mapper)
          Doses the actual querying and registration of DozerTypeConverters with the CamelContext.
 void setCamelContext(org.apache.camel.CamelContext camelContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DozerTypeConverterLoader

public DozerTypeConverterLoader()
Creates a DozerTypeConverter performing no TypeConverter registration.


DozerTypeConverterLoader

public DozerTypeConverterLoader(org.apache.camel.CamelContext camelContext)
Creates a DozerTypeConverter that will search the given CamelContext for instances of DozerBeanMapper. Each discovered instance will be wrapped as a DozerTypeConverter and register as a TypeConverter with the context

Parameters:
camelContext - the context to register the DozerTypeConverter in

DozerTypeConverterLoader

public DozerTypeConverterLoader(org.apache.camel.CamelContext camelContext,
                                org.dozer.DozerBeanMapper mapper)
Creates a DozerTypeConverter that will wrap the the given DozerBeanMapper as a DozerTypeConverter and register it with the given context. It will also search the context for

Parameters:
camelContext - the context to register the DozerTypeConverter in
mapper - the DozerMapperBean to be wrapped as a type converter.
Method Detail

init

public void init(org.apache.camel.CamelContext camelContext,
                 org.dozer.DozerBeanMapper mapper)
Doses the actual querying and registration of DozerTypeConverters with the CamelContext.

Parameters:
camelContext - the context to register the DozerTypeConverter in
mapper - the DozerMapperBean to be wrapped as a type converter.

addMapping

public void addMapping(org.dozer.loader.api.BeanMappingBuilder beanMappingBuilder)
Registers Dozer BeanMappingBuilder in current mapper instance. This method should be called instead of direct mapper.addMapping() invocation for Camel being able to register given type conversion.

Parameters:
beanMappingBuilder - api-based mapping builder

getCamelContext

public org.apache.camel.CamelContext getCamelContext()
Specified by:
getCamelContext in interface org.apache.camel.CamelContextAware

setCamelContext

public void setCamelContext(org.apache.camel.CamelContext camelContext)
Specified by:
setCamelContext in interface org.apache.camel.CamelContextAware


Apache CAMEL