com.gisgraphy.util
Class TimestampConverter
java.lang.Object
com.gisgraphy.util.DateConverter
com.gisgraphy.util.TimestampConverter
- All Implemented Interfaces:
- org.apache.commons.beanutils.Converter
public class TimestampConverter
- extends DateConverter
This class is converts a java.util.Date to a String and a String to a
java.util.Date for use as a Timestamp. It is used by BeanUtils when copying
properties.
- Author:
- Dan Kibler
Field Summary |
static java.lang.String |
TS_FORMAT
i18n-ized timestamp format - based on values in
ApplicationResources.properties |
Method Summary |
protected java.lang.Object |
convertToDate(java.lang.Class type,
java.lang.Object value)
Convert a String to a date |
protected java.lang.Object |
convertToString(java.lang.Class type,
java.lang.Object value)
Convert from a java.util.Date to a String |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TS_FORMAT
public static final java.lang.String TS_FORMAT
- i18n-ized timestamp format - based on values in
ApplicationResources.properties
TimestampConverter
public TimestampConverter()
convertToDate
protected java.lang.Object convertToDate(java.lang.Class type,
java.lang.Object value)
- Convert a String to a date
- Parameters:
type
- java.util.Datevalue
- the String value
- Returns:
- a converted date
convertToString
protected java.lang.Object convertToString(java.lang.Class type,
java.lang.Object value)
- Convert from a java.util.Date to a String
- Overrides:
convertToString
in class DateConverter
- Parameters:
type
- java.lang.Stringvalue
- the date instance
- Returns:
- string version of date using default date pattern
Copyright © 2010. All Rights Reserved.