Module org.apache.wicket.util
Class AbstractConverter<C>
java.lang.Object
org.apache.wicket.util.convert.converter.AbstractConverter<C>
- Type Parameters:
C
-
- All Implemented Interfaces:
Serializable
,IConverter<C>
,IClusterable
- Direct Known Subclasses:
AbstractDateConverter
,AbstractJavaTimeConverter
,AbstractNumberConverter
,BooleanConverter
,CharacterConverter
Base class for locale aware type converters.
- Author:
- Eelco Hillenius
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertToString
(C value, Locale locale) Converts the given value to a string.protected ConversionException
newConversionException
(String message, Object value, Locale locale) Creates a conversion exception for throwingprotected C
Parses a value using one of the java.util.text format classes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wicket.util.convert.IConverter
convertToObject
-
Constructor Details
-
AbstractConverter
public AbstractConverter()
-
-
Method Details
-
parse
Parses a value using one of the java.util.text format classes.- Parameters:
format
- The format to usevalue
- The object to parselocale
- The locale to use to parse.- Returns:
- The object
- Throws:
ConversionException
- Thrown if parsing fails
-
newConversionException
Creates a conversion exception for throwing- Parameters:
message
- The messagevalue
- The value that didn't convertlocale
- The locale- Returns:
- The ConversionException
-
getTargetType
- Returns:
- The target type of this type converter
-
convertToString
Description copied from interface:IConverter
Converts the given value to a string.- Specified by:
convertToString
in interfaceIConverter<C>
- Parameters:
value
- The value to convertlocale
- The locale used to convert the value- Returns:
- The converted string value
- See Also:
-