public class InstanceMethodTypeConverter extends TypeConverterSupport
TypeConverter
implementation which instantiates an object
so that an instance method can be used as a type converterConstructor and Description |
---|
InstanceMethodTypeConverter(CachingInjector<?> injector,
Method method,
TypeConverterRegistry registry)
Deprecated.
|
InstanceMethodTypeConverter(CachingInjector<?> injector,
Method method,
TypeConverterRegistry registry,
boolean allowNull) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowNull()
Whether the type converter allows returning null as a valid response.
|
<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).
|
String |
toString() |
convertTo, mandatoryConvertTo, mandatoryConvertTo, tryConvertTo, tryConvertTo
@Deprecated public InstanceMethodTypeConverter(CachingInjector<?> injector, Method method, TypeConverterRegistry registry)
public InstanceMethodTypeConverter(CachingInjector<?> injector, Method method, TypeConverterRegistry registry, boolean allowNull)
public boolean allowNull()
TypeConverter
allowNull
in interface TypeConverter
allowNull
in class TypeConverterSupport
public <T> T convertTo(Class<T> type, Exchange exchange, Object value)
TypeConverter
type
- the requested typeexchange
- the current exchangevalue
- the value to be convertedApache Camel