public interface TypeConverterFactory extends ConfigurableComponent
| Modifier and Type | Method and Description |
|---|---|
void |
add(Class<?> targetType,
Class<? extends TypeConverter<?>> converterClass)
Adds a type converter to the set of registered type converters, overriding an existing
converter if one was already registered for the type.
|
TypeConverter |
getInstance(Class<? extends TypeConverter> clazz,
Locale locale)
Gets an instance of the TypeConverter class specified.
|
TypeConverter |
getTypeConverter(Class forType,
Locale locale)
Gets the applicable type converter for the class passed in.
|
initTypeConverter getTypeConverter(Class forType, Locale locale) throws Exception
forType - the type/Class that is the target type of the conversion. It is assumed that
the input type is String, so to convert a String to a Date object you would supply
java.util.Date.class.locale - the locale of the Strings to be converted with the returned converterException - if the TypeConverter cannot be instantiatedTypeConverter getInstance(Class<? extends TypeConverter> clazz, Locale locale) throws Exception
clazz - the Class object representing the desired TypeConverterlocale - the locale of the Strings to be converted with the returned converterException - if the TypeConverter cannot be instantiatedvoid add(Class<?> targetType, Class<? extends TypeConverter<?>> converterClass)
UnsupportedOperationException.targetType - the type for which the converter will handle conversionsconverterClass - the implementation class that will handle the conversionsUnsupportedOperationException - if the implementation does not support adding type
converters at runtime© Copyright 2005-2006, Stripes Development Team.