Interface ConverterRegistry

    • Method Detail

      • addConverter

        void addConverter​(Converter<?,​?> converter)
        Add a plain converter to this registry. The convertible source/target type pair is derived from the Converter's parameterized types.
        Throws:
        IllegalArgumentException - if the parameterized types could not be resolved
      • addConverter

        <S,​T> void addConverter​(Class<S> sourceType,
                                      Class<T> targetType,
                                      Converter<? super S,​? extends T> converter)
        Add a plain converter to this registry. The convertible source/target type pair is specified explicitly.

        Allows for a Converter to be reused for multiple distinct pairs without having to create a Converter class for each pair.

        Since:
        3.1
      • addConverterFactory

        void addConverterFactory​(ConverterFactory<?,​?> factory)
        Add a ranged converter factory to this registry. The convertible source/target type pair is derived from the ConverterFactory's parameterized types.
        Throws:
        IllegalArgumentException - if the parameterized types could not be resolved
      • removeConvertible

        void removeConvertible​(Class<?> sourceType,
                               Class<?> targetType)
        Remove any converters from sourceType to targetType.
        Parameters:
        sourceType - the source type
        targetType - the target type