Package org.apache.camel.support
Class SimpleTypeConverter
- java.lang.Object
-
- org.apache.camel.support.SimpleTypeConverter
-
- All Implemented Interfaces:
org.apache.camel.TypeConverter
public class SimpleTypeConverter extends Object implements org.apache.camel.TypeConverter
Another base class forTypeConverterimplementations. Implementators need only to implement aSimpleTypeConverter.ConversionMethodmethod, and can rely on the default implementations of the other methods from this support class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSimpleTypeConverter.ConversionMethod
-
Constructor Summary
Constructors Constructor Description SimpleTypeConverter(boolean allowNull, SimpleTypeConverter.ConversionMethod method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowNull()<T> TconvertTo(Class<T> type, Object value)<T> TconvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)<T> TmandatoryConvertTo(Class<T> type, Object value)<T> TmandatoryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)<T> TtryConvertTo(Class<T> type, Object value)<T> TtryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
-
-
-
Constructor Detail
-
SimpleTypeConverter
public SimpleTypeConverter(boolean allowNull, SimpleTypeConverter.ConversionMethod method)
-
-
Method Detail
-
allowNull
public boolean allowNull()
- Specified by:
allowNullin interfaceorg.apache.camel.TypeConverter
-
convertTo
public <T> T convertTo(Class<T> type, Object value) throws org.apache.camel.TypeConversionException
- Specified by:
convertToin interfaceorg.apache.camel.TypeConverter- Throws:
org.apache.camel.TypeConversionException
-
mandatoryConvertTo
public <T> T mandatoryConvertTo(Class<T> type, Object value) throws org.apache.camel.TypeConversionException, org.apache.camel.NoTypeConversionAvailableException
- Specified by:
mandatoryConvertToin interfaceorg.apache.camel.TypeConverter- Throws:
org.apache.camel.TypeConversionExceptionorg.apache.camel.NoTypeConversionAvailableException
-
mandatoryConvertTo
public <T> T mandatoryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value) throws org.apache.camel.TypeConversionException, org.apache.camel.NoTypeConversionAvailableException
- Specified by:
mandatoryConvertToin interfaceorg.apache.camel.TypeConverter- Throws:
org.apache.camel.TypeConversionExceptionorg.apache.camel.NoTypeConversionAvailableException
-
tryConvertTo
public <T> T tryConvertTo(Class<T> type, Object value)
- Specified by:
tryConvertToin interfaceorg.apache.camel.TypeConverter
-
tryConvertTo
public <T> T tryConvertTo(Class<T> type, org.apache.camel.Exchange exchange, Object value)
- Specified by:
tryConvertToin interfaceorg.apache.camel.TypeConverter
-
-