org.apache.camel.converter.dozer
Class DozerTypeConverter

java.lang.Object
  extended by org.apache.camel.converter.dozer.DozerTypeConverter
All Implemented Interfaces:
TypeConverter

public class DozerTypeConverter
extends Object
implements TypeConverter

DozerTypeConverter is a standard TypeConverter that delegates to a Mapper from the Dozer framework to convert between types. DozerTypeConverters are created and installed into a CamelContext by an instance of DozerTypeConverterLoader.

See http://dozer.sourceforge.net} or more information on configuring Dozer

See Also:
DozerTypeConverterLoader

Constructor Summary
DozerTypeConverter(org.dozer.DozerBeanMapper mapper)
           
 
Method Summary
<T> T
convertTo(Class<T> type, Exchange exchange, Object value)
          Converts the value to the specified type in the context of an exchange

Used when conversion requires extra information from the current exchange (such as encoding).

<T> T
convertTo(Class<T> type, Object value)
          Converts the value to the specified type
<T> T
mandatoryConvertTo(Class<T> type, Exchange exchange, Object value)
          Converts the value to the specified type in the context of an exchange

Used when conversion requires extra information from the current exchange (such as encoding).

<T> T
mandatoryConvertTo(Class<T> type, Object value)
          Converts the value to the specified type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DozerTypeConverter

public DozerTypeConverter(org.dozer.DozerBeanMapper mapper)
Method Detail

convertTo

public <T> T convertTo(Class<T> type,
                       Object value)
Description copied from interface: TypeConverter
Converts the value to the specified type

Specified by:
convertTo in interface TypeConverter
Parameters:
type - the requested type
value - the value to be converted
Returns:
the converted value, or null if not possible to convert

convertTo

public <T> T convertTo(Class<T> type,
                       Exchange exchange,
                       Object value)
Description copied from interface: TypeConverter
Converts the value to the specified type in the context of an exchange

Used when conversion requires extra information from the current exchange (such as encoding).

Specified by:
convertTo in interface TypeConverter
Parameters:
type - the requested type
exchange - the current exchange
value - the value to be converted
Returns:
the converted value, or null if not possible to convert

mandatoryConvertTo

public <T> T mandatoryConvertTo(Class<T> type,
                                Object value)
                     throws NoTypeConversionAvailableException
Description copied from interface: TypeConverter
Converts the value to the specified type

Specified by:
mandatoryConvertTo in interface TypeConverter
Parameters:
type - the requested type
value - the value to be converted
Returns:
the converted value, is never null
Throws:
NoTypeConversionAvailableException - if conversion not possible

mandatoryConvertTo

public <T> T mandatoryConvertTo(Class<T> type,
                                Exchange exchange,
                                Object value)
                     throws NoTypeConversionAvailableException
Description copied from interface: TypeConverter
Converts the value to the specified type in the context of an exchange

Used when conversion requires extra information from the current exchange (such as encoding).

Specified by:
mandatoryConvertTo in interface TypeConverter
Parameters:
type - the requested type
exchange - the current exchange
value - the value to be converted
Returns:
the converted value, is never null
Throws:
NoTypeConversionAvailableException


Apache CAMEL