wicket.util.convert.converters
Class AbstractConverter

java.lang.Object
  extended by wicket.util.convert.converters.AbstractConverter
All Implemented Interfaces:
java.io.Serializable, ITypeConverter
Direct Known Subclasses:
AbstractNumberConverter, BooleanConverter, CharacterConverter, DateConverter, DateToStringConverter, NumberToStringConverter, StringConverter

public abstract class AbstractConverter
extends java.lang.Object
implements ITypeConverter

Base class for locale aware type converters.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
AbstractConverter()
           
 
Method Summary
protected abstract  java.lang.Class getTargetType()
           
protected  ConversionException newConversionException(java.lang.String message, java.lang.Object value, java.util.Locale locale)
          Creates a conversion exception for throwing
protected  java.lang.Object parse(java.text.Format format, java.lang.Object value)
          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 wicket.util.convert.ITypeConverter
convert
 

Constructor Detail

AbstractConverter

public AbstractConverter()
Method Detail

parse

protected java.lang.Object parse(java.text.Format format,
                                 java.lang.Object value)
Parses a value using one of the java.util.text format classes.

Parameters:
format - The format to use
value - The object to parse
Returns:
The object
Throws:
ConversionException - Thrown if parsing fails

newConversionException

protected ConversionException newConversionException(java.lang.String message,
                                                     java.lang.Object value,
                                                     java.util.Locale locale)
Creates a conversion exception for throwing

Parameters:
message - The message
value - The value that didn't convert
locale - The locale
Returns:
The ConversionException

getTargetType

protected abstract java.lang.Class getTargetType()
Returns:
The target type of this type converter


Copyright © 2004-2007 Wicket developers. All Rights Reserved.