Class TypeConverterSupport

  • All Implemented Interfaces:
    org.apache.camel.TypeConverter

    public abstract class TypeConverterSupport
    extends Object
    implements org.apache.camel.TypeConverter
    Base class for TypeConverter implementations.

    Implementators need only to implement the TypeConverter.convertTo(Class, org.apache.camel.Exchange, Object) method, and can rely on the default implementations of the other methods from this support class.

    • Constructor Detail

      • TypeConverterSupport

        public TypeConverterSupport()
    • Method Detail

      • allowNull

        public boolean allowNull()
        Specified by:
        allowNull in interface org.apache.camel.TypeConverter
      • convertTo

        public <T> T convertTo​(Class<T> type,
                               Object value)
                        throws org.apache.camel.TypeConversionException
        Specified by:
        convertTo in interface org.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:
        mandatoryConvertTo in interface org.apache.camel.TypeConverter
        Throws:
        org.apache.camel.TypeConversionException
        org.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:
        mandatoryConvertTo in interface org.apache.camel.TypeConverter
        Throws:
        org.apache.camel.TypeConversionException
        org.apache.camel.NoTypeConversionAvailableException
      • tryConvertTo

        public <T> T tryConvertTo​(Class<T> type,
                                  Object value)
        Specified by:
        tryConvertTo in interface org.apache.camel.TypeConverter
      • tryConvertTo

        public <T> T tryConvertTo​(Class<T> type,
                                  org.apache.camel.Exchange exchange,
                                  Object value)
        Specified by:
        tryConvertTo in interface org.apache.camel.TypeConverter