org.scopemvc.util.convertor
Class StringConvertors

java.lang.Object
  |
  +--org.scopemvc.util.convertor.StringConvertors

public class StringConvertors
extends java.lang.Object

Factory class for creation of default convertors for arbitrary classes.
You can use a custom factory with a different strategy for locating the convertors. For that, put the class name of your factory in the StringConvertors property in the Scope configuration.

Version:
$Revision: 1.6 $ $Date: 2002/09/05 15:41:47 $
Author:
Daniel Michalik

Constructor Summary
StringConvertors()
          Load convertors from ScopeConfig.
 
Method Summary
protected  StringConvertor findConvertor(java.lang.Class inValueClass)
          Return a StringConvertor for the passed Class, else return null.
static StringConvertor forClass(java.lang.Class inValueClass)
          Return a StringConvertor for the passed Class, else return null.
protected  void registerConvertor(java.lang.Class inValueClass, StringConvertor inConvertor)
          Register a new convertor for the value class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringConvertors

public StringConvertors()
Load convertors from ScopeConfig.

Method Detail

forClass

public static StringConvertor forClass(java.lang.Class inValueClass)
Return a StringConvertor for the passed Class, else return null.
Note that this doesn't work for subclasses of datatypes types: the type must match exactly.

Parameters:
inValueClass - Description of the Parameter
Returns:
Description of the Return Value

findConvertor

protected StringConvertor findConvertor(java.lang.Class inValueClass)
Return a StringConvertor for the passed Class, else return null.
The default implementation doesn't work for subclasses of datatypes types: the type must match exactly.

Parameters:
inValueClass - Description of the Parameter
Returns:
Description of the Return Value

registerConvertor

protected void registerConvertor(java.lang.Class inValueClass,
                                 StringConvertor inConvertor)
Register a new convertor for the value class.

Parameters:
inValueClass - The value class with the convertor to register
inConvertor - The StringConvertor instance for the value class.


Copyright © 2000-2002 The Scope Team. All Rights Reserved.