com.gisgraphy.util
Class TimestampConverter

java.lang.Object
  extended by com.gisgraphy.util.DateConverter
      extended by 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
 
Constructor Summary
TimestampConverter()
           
 
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 com.gisgraphy.util.DateConverter
convert, convertToDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TS_FORMAT

public static final java.lang.String TS_FORMAT
i18n-ized timestamp format - based on values in ApplicationResources.properties

Constructor Detail

TimestampConverter

public TimestampConverter()
Method Detail

convertToDate

protected java.lang.Object convertToDate(java.lang.Class type,
                                         java.lang.Object value)
Convert a String to a date

Parameters:
type - java.util.Date
value - 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.String
value - the date instance
Returns:
string version of date using default date pattern


Copyright © 2010. All Rights Reserved.