|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.stripes.validation.DefaultTypeConverterFactory
public class DefaultTypeConverterFactory
Default TypeConverterFactory implementation that simply creates an instance level map of all the TypeConverters included in the Stripes distribution, and their applicable classes. Can handle all the primitive and wrapper types as well as the rich types for which type converters exist.
| Field Summary | |
|---|---|
protected Configuration |
configuration
Stores a reference to the Configuration passed in at initialization time. |
| Constructor Summary | |
|---|---|
DefaultTypeConverterFactory()
|
|
| Method Summary | |
|---|---|
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. |
void |
init(Configuration configuration)
Places all the known convertible types and type converters into an instance level Map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Configuration configuration
| Constructor Detail |
|---|
public DefaultTypeConverterFactory()
| Method Detail |
|---|
public void init(Configuration configuration)
init in interface ConfigurableComponentconfiguration - the Configuration object being used by Stripes
public TypeConverter getTypeConverter(Class forType,
Locale locale)
throws Exception
getTypeConverter in interface TypeConverterFactoryforType - 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 converter
Exception - if the TypeConverter cannot be instantiated
public TypeConverter getInstance(Class<? extends TypeConverter> clazz,
Locale locale)
throws Exception
getInstance in interface TypeConverterFactoryclazz - the TypeConverter type that is desiredlocale - the locale of the Strings to be converted with the returned converter
Exception - if there is a problem instantiating the TypeConverter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||