org.apache.camel
Interface TypeConverter

All Known Implementing Classes:
ArrayTypeConverter, AsyncProcessorTypeConverter, DefaultTypeConverter, EnumTypeConverter, InstanceMethodTypeConverter, PropertyEditorTypeConverter, StaticMethodTypeConverter, ToStringTypeConverter

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

Version:
$Revision: 46968 $

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
<T> T
convertTo(Class<T> type, Object value)
          Converts the value to the specified type
 

Method Detail

convertTo

<T> T convertTo(Class<T> type,
                Object value)
Converts the value to the specified type

Parameters:
type - the requested type
value - the value to be converted
Returns:
the converted value or null if it can not be converted

convertTo

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

Parameters:
type - the requested type
current - exchange
value - the value to be converted
Returns:
the converted value or null if it can not be converted Used when conversion requires extra information from the current exchange (such as encoding).


Copyright © 2008 IONA Open Source Community. All Rights Reserved.