wicket.util.convert.converters
Class DateConverter

java.lang.Object
  extended by wicket.util.convert.converters.AbstractConverter
      extended by wicket.util.convert.converters.DateConverter
All Implemented Interfaces:
java.io.Serializable, ITypeConverter

public class DateConverter
extends AbstractConverter

Converts from Object to Date.

Author:
Eelco Hillenius
See Also:
Serialized Form

Constructor Summary
DateConverter()
          Construct.
DateConverter(boolean lenient)
          Construct.
 
Method Summary
 java.lang.Object convert(java.lang.Object value, java.util.Locale locale)
          Converts the given value
 java.text.DateFormat getDateFormat(java.util.Locale locale)
           
protected  java.lang.Class getTargetType()
           
 void setDateFormat(java.util.Locale locale, java.text.DateFormat dateFormat)
           
 
Methods inherited from class wicket.util.convert.converters.AbstractConverter
newConversionException, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateConverter

public DateConverter()
Construct. Lenient is false.


DateConverter

public DateConverter(boolean lenient)
Construct.

Parameters:
lenient - when true, parsing is lenient. With lenient parsing, the parser may use heuristics to interpret inputs that do not precisely match this object's format. With strict parsing, inputs must match the object's format.
Method Detail

convert

public java.lang.Object convert(java.lang.Object value,
                                java.util.Locale locale)
Description copied from interface: ITypeConverter
Converts the given value

Parameters:
value - The value to convert
Returns:
The converted value
See Also:
ITypeConverter.convert(java.lang.Object,java.util.Locale)

getDateFormat

public java.text.DateFormat getDateFormat(java.util.Locale locale)
Parameters:
locale -
Returns:
Returns the date format.

setDateFormat

public void setDateFormat(java.util.Locale locale,
                          java.text.DateFormat dateFormat)
Parameters:
locale -
dateFormat - The dateFormat to set.

getTargetType

protected java.lang.Class getTargetType()
Specified by:
getTargetType in class AbstractConverter
Returns:
The target type of this type converter
See Also:
AbstractConverter.getTargetType()


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