org.apache.camel.impl.converter
Class InstanceMethodTypeConverter

java.lang.Object
  extended by org.apache.camel.impl.converter.InstanceMethodTypeConverter
All Implemented Interfaces:
TypeConverter

public class InstanceMethodTypeConverter
extends Object
implements TypeConverter

A TypeConverter implementation which instantiates an object so that an instance method can be used as a type converter

Version:
$Revision: 46981 $

Constructor Summary
InstanceMethodTypeConverter(CachingInjector injector, Method method)
           
 
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
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InstanceMethodTypeConverter

public InstanceMethodTypeConverter(CachingInjector injector,
                                   Method method)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

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 it can not be converted

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 it can not be converted


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