org.apache.camel.impl.converter
Class InstanceMethodFallbackTypeConverter
java.lang.Object
org.apache.camel.support.TypeConverterSupport
org.apache.camel.impl.converter.InstanceMethodFallbackTypeConverter
- All Implemented Interfaces:
- TypeConverter
public class InstanceMethodFallbackTypeConverter
- extends TypeConverterSupport
A TypeConverter
implementation which instantiates an object
so that an instance method can be used as a fallback type converter
- Version:
Method Summary |
boolean |
allowNull()
Whether the type converter allows returning null as a valid response. |
|
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). |
String |
toString()
|
InstanceMethodFallbackTypeConverter
@Deprecated
public InstanceMethodFallbackTypeConverter(CachingInjector<?> injector,
Method method,
TypeConverterRegistry registry)
- Deprecated.
InstanceMethodFallbackTypeConverter
public InstanceMethodFallbackTypeConverter(CachingInjector<?> injector,
Method method,
TypeConverterRegistry registry,
boolean allowNull)
toString
public String toString()
- Overrides:
toString
in class Object
allowNull
public boolean allowNull()
- Description copied from interface:
TypeConverter
- Whether the type converter allows returning null as a valid response.
By default null is not a valid response, returning false from this method.
- Specified by:
allowNull
in interface TypeConverter
- Overrides:
allowNull
in class TypeConverterSupport
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).
- Parameters:
type
- the requested typeexchange
- the current exchangevalue
- the value to be converted
- Returns:
- the converted value, or null if not possible to convert
Apache Camel