public abstract class StrutsTypeConverter extends DefaultTypeConverter
performFallbackConversion of which
could be used to perform some fallback conversion if convertValue method of this
failed. By default it just ask its super class (Ognl's DefaultTypeConverter) to do the conversion.
To allow the framework to recognize that a conversion error has occurred, throw an XWorkException or
preferable a TypeConversionException.
MILLISECOND_FORMATNO_CONVERSION_POSSIBLE, TYPE_CONVERTER_CONTEXT_KEY| Constructor and Description |
|---|
StrutsTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
abstract Object |
convertFromString(Map context,
String[] values,
Class toClass)
Converts one or more String values to the specified class.
|
abstract String |
convertToString(Map context,
Object o)
Converts the specified object to a String.
|
Object |
convertValue(Map context,
Object o,
Class toClass) |
protected Object |
performFallbackConversion(Map context,
Object o,
Class toClass)
Hook to perform a fallback conversion if every default options failed.
|
bigDecValue, bigIntValue, booleanValue, convertValue, convertValue, doubleValue, enumValue, getLocale, getTypeConverter, longValue, setContainer, stringValue, stringValuepublic Object convertValue(Map context, Object o, Class toClass)
convertValue in class DefaultTypeConverterprotected Object performFallbackConversion(Map context, Object o, Class toClass)
context - o - toClass - public abstract Object convertFromString(Map context, String[] values, Class toClass)
context - the action contextvalues - the String values to be converted, such as those submitted from an HTML formtoClass - the class to convert toCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.