org.castor.cpa.persistence.convertor
Class TypeConvertorRegistry

java.lang.Object
  extended byorg.castor.cpa.persistence.convertor.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

Constructor Summary
TypeConvertorRegistry(org.castor.core.util.Configuration config)
          Create a new registry instance of type convertors.
 
Method Summary
 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(org.castor.core.util.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 Detail

getConvertor

public TypeConvertor getConvertor(java.lang.Class fromType,
                                  java.lang.Class toType,
                                  java.lang.String parameter)
                           throws org.exolab.castor.mapping.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:
org.exolab.castor.mapping.MappingException - No suitable convertor was found.


Copyright 2008 null. All Rights Reserved.