|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeConverter
A pluggable strategy to be able to convert objects to different types such as to and from String, InputStream/OutputStream, Reader/Writer, Document, byte[], ByteBuffer etc
Method Summary | ||
---|---|---|
|
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). |
|
|
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. |
Method Detail |
---|
<T> T convertTo(Class<T> type, Object value) throws TypeConversionException
type
- the requested typevalue
- the value to be converted
TypeConversionException
- is thrown if error during type conversion<T> T convertTo(Class<T> type, Exchange exchange, Object value) throws TypeConversionException
type
- the requested typeexchange
- the current exchangevalue
- the value to be converted
TypeConversionException
- is thrown if error during type conversion<T> T mandatoryConvertTo(Class<T> type, Object value) throws TypeConversionException, NoTypeConversionAvailableException
type
- 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
NoTypeConversionAvailableException
<T> T mandatoryConvertTo(Class<T> type, Exchange exchange, Object value) throws TypeConversionException, NoTypeConversionAvailableException
type
- 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
NoTypeConversionAvailableException
<T> T tryConvertTo(Class<T> type, Object value)
type
- the requested typevalue
- the value to be converted
<T> T tryConvertTo(Class<T> type, Exchange exchange, Object value)
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 |