org.apache.wicket.util.convert.converters
Class AbstractConverter
java.lang.Object
org.apache.wicket.util.convert.converters.AbstractConverter
- All Implemented Interfaces:
- Serializable, IClusterable, IConverter
- Direct Known Subclasses:
- AbstractNumberConverter, BooleanConverter, CharacterConverter, DateConverter, SqlDateConverter, SqlTimeConverter, SqlTimestampConverter
public abstract class AbstractConverter
- extends Object
- implements IConverter
Base class for locale aware type converters.
- Author:
- Eelco Hillenius
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractConverter
public AbstractConverter()
parse
protected Object parse(Format format,
Object value,
Locale locale)
- 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
protected ConversionException newConversionException(String message,
Object value,
Locale locale)
- Creates a conversion exception for throwing
- Parameters:
message
- The messagevalue
- The value that didn't convertlocale
- The locale
- Returns:
- The ConversionException
getTargetType
protected abstract Class<?> getTargetType()
- Returns:
- The target type of this type converter
convertToString
public String convertToString(Object value,
Locale locale)
- Description copied from interface:
IConverter
- Converts the given value to a string.
- Specified by:
convertToString
in interface IConverter
- Parameters:
value
- The value to convertlocale
- The locale used to convert the value
- Returns:
- The converted string value
- See Also:
IConverter.convertToString(java.lang.Object, Locale)
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.