Class TypeConvertorRegistry


  • public final class TypeConvertorRegistry
    extends java.lang.Object
    Registry of type convertors.
    Since:
    1.1.3
    Version:
    $Revision: 7134 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
    Author:
    Ralf Joachim
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      TypeConvertor getConvertor​(java.lang.Class<?> fromType, java.lang.Class<?> toType, java.lang.String parameter)
      Returns a type convertor initialized with parameter if specified.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TypeConvertorRegistry

        public TypeConvertorRegistry​(AbstractProperties properties)
        Create a new registry instance of type convertors. The registry will be initialized with all type convertors specified through TYPE_CONVERTORS property of given properties. The properties get also passed to the type converters for them to get any required property.
        Parameters:
        properties - The properties to use.
    • Method Detail

      • getConvertor

        public TypeConvertor getConvertor​(java.lang.Class<?> fromType,
                                          java.lang.Class<?> toType,
                                          java.lang.String parameter)
                                   throws MappingException
        Returns a type convertor initialized with parameter if specified. A type convertor can be used to convert an object from Java type fromType to Java type toType.
        Parameters:
        fromType - The Java type to convert from.
        toType - The Java type to convert to.
        parameter - The parameter for the convertor (null if is not specified).
        Returns:
        The TypeConverter to convert fromType into toType.
        Throws:
        MappingException - No suitable convertor was found.