|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.support.TypeConverterSupport
public abstract class TypeConverterSupport
Base class for TypeConverter
implementations.
TypeConverter.convertTo(Class, org.apache.camel.Exchange, Object)
method, and can rely on the default implementations of the other methods from this support class.
Constructor Summary | |
---|---|
TypeConverterSupport()
|
Method Summary | ||
---|---|---|
|
convertTo(Class<T> type,
Object value)
Converts the value to the specified type |
|
|
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). |
|
|
mandatoryConvertTo(Class<T> type,
Object value)
Converts the value to the specified type |
|
|
tryConvertTo(Class<T> type,
Exchange exchange,
Object value)
Tries to convert the value to the specified type in the context of an exchange, returning null if not possible to convert. |
|
|
tryConvertTo(Class<T> type,
Object value)
Tries to convert the value to the specified type, returning null if not possible to convert. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.camel.TypeConverter |
---|
convertTo |
Constructor Detail |
---|
public TypeConverterSupport()
Method Detail |
---|
public <T> T convertTo(Class<T> type, Object value) throws TypeConversionException
TypeConverter
convertTo
in interface TypeConverter
type
- the requested typevalue
- the value to be converted
TypeConversionException
- is thrown if error during type conversionpublic <T> T mandatoryConvertTo(Class<T> type, Object value) throws TypeConversionException, NoTypeConversionAvailableException
TypeConverter
mandatoryConvertTo
in interface TypeConverter
type
- the requested typevalue
- the value to be converted
TypeConversionException
- is thrown if error during type conversion
NoTypeConversionAvailableException
public <T> T mandatoryConvertTo(Class<T> type, Exchange exchange, Object value) throws TypeConversionException, NoTypeConversionAvailableException
TypeConverter
mandatoryConvertTo
in interface TypeConverter
type
- the requested typeexchange
- the current exchangevalue
- the value to be converted
TypeConversionException
- is thrown if error during type conversion
NoTypeConversionAvailableException
public <T> T tryConvertTo(Class<T> type, Object value)
TypeConverter
tryConvertTo
in interface TypeConverter
type
- the requested typevalue
- the value to be converted
public <T> T tryConvertTo(Class<T> type, Exchange exchange, Object value)
TypeConverter
tryConvertTo
in interface TypeConverter
type
- the requested typeexchange
- the current exchangevalue
- the value to be converted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |