|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 | ||
|---|---|---|
boolean |
allowNull()
Whether the type converter allows returning null as a valid response. |
|
|
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 boolean allowNull()
TypeConverter
allowNull in interface TypeConverter
public <T> T convertTo(Class<T> type,
Object value)
throws TypeConversionException
TypeConverter
convertTo in interface TypeConvertertype - the requested typevalue - the value to be converted
TypeConversionException - is thrown if error during type conversion
public <T> T mandatoryConvertTo(Class<T> type,
Object value)
throws TypeConversionException,
NoTypeConversionAvailableException
TypeConverter
mandatoryConvertTo in interface TypeConvertertype - the requested typevalue - the value to be converted
TypeConversionException - is thrown if error during type conversion
NoTypeConversionAvailableException - if no type converters exists to convert to the given type
public <T> T mandatoryConvertTo(Class<T> type,
Exchange exchange,
Object value)
throws TypeConversionException,
NoTypeConversionAvailableException
TypeConverter
mandatoryConvertTo in interface TypeConvertertype - the requested typeexchange - the current exchangevalue - the value to be converted
TypeConversionException - is thrown if error during type conversion
NoTypeConversionAvailableException - if no type converters exists to convert to the given type
public <T> T tryConvertTo(Class<T> type,
Object value)
TypeConverter
tryConvertTo in interface TypeConvertertype - the requested typevalue - the value to be converted
public <T> T tryConvertTo(Class<T> type,
Exchange exchange,
Object value)
TypeConverter
tryConvertTo in interface TypeConvertertype - 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 | |||||||||