org.castor.cpa.persistence.convertor

Class TypeConvertorRegistry


public final class TypeConvertorRegistry
extends java.lang.Object

Registry of type convertors.
Version:
$Revision: 7134 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Ralf Joachim
Since:
1.1.3

Constructor Summary

TypeConvertorRegistry(Configuration config)
Create a new registry instance of type convertors.

Method Summary

TypeConvertor
getConvertor(Class fromType, Class toType, String parameter)
Returns a type convertor initialized with parameter if specified.

Constructor Details

TypeConvertorRegistry

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

Method Details

getConvertor

public TypeConvertor getConvertor(Class fromType,
                                  Class toType,
                                  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.

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com