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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TS_FORMAT` i18n-ized timestamp format - based on values in ApplicationResources.properties

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimestampConverter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `convertToDate(Class type, Object value)` Convert a String to a date
    `protected Object` | `convertToString(Class type, 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 String TS_FORMAT

      i18n-ized timestamp format - based on values in ApplicationResources.properties

  - ### Constructor Detail

    - #### TimestampConverter

          public TimestampConverter()

  - ### Method Detail

    - #### convertToDate

          protected Object convertToDate(Class type,
                             Object value)

      Convert a String to a date
      Parameters:
        `type` - java.util.Date
        `value` - the String value
      Returns:
        a converted date

    - #### convertToString

          protected Object convertToString(Class type,
                               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 © 2015. All rights reserved.