org.gvsig.tools.dataTypes.impl.coercion
Class CoerceToDateTime

java.lang.Object
  extended by org.gvsig.tools.dataTypes.impl.coercion.AbstractCoerceToDate
      extended by org.gvsig.tools.dataTypes.impl.coercion.CoerceToDateTime
All Implemented Interfaces:
DataTypesManager.Coercion

public class CoerceToDateTime
extends AbstractCoerceToDate

Coerces a value to a Date. If the value is not a Date, it will use the Object.toString() method to convert the resulting String to a Date object using the current locale default formatter for DateTime through the DateFormat#getDateTimeInstance(int) method and the DateFormat.SHORT style for the date and the DateFormat.MEDIUM style for the hour.

Version:
$Id$
Author:
gvSIG Team

Constructor Summary
CoerceToDateTime()
           
 
Method Summary
protected  DateFormat createFormatter()
          Returns the DateFormat to apply when the value to coerce is not of Date type and it will be parsed as String.
protected  String getDateType()
          Returns the name of the Date type being coerced.
 
Methods inherited from class org.gvsig.tools.dataTypes.impl.coercion.AbstractCoerceToDate
coerce
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoerceToDateTime

public CoerceToDateTime()
Method Detail

createFormatter

protected DateFormat createFormatter()
Description copied from class: AbstractCoerceToDate
Returns the DateFormat to apply when the value to coerce is not of Date type and it will be parsed as String.

Specified by:
createFormatter in class AbstractCoerceToDate
Returns:
the DateFormat to apply to parse the value to coerce as String

getDateType

protected String getDateType()
Description copied from class: AbstractCoerceToDate
Returns the name of the Date type being coerced. Ex: Date, DateTime, Time. Only used for description when an error is produced when coercing the value.

Specified by:
getDateType in class AbstractCoerceToDate
Returns:
the name of the Date type being coerced


Copyright © 2004-2011 gvSIG. All Rights Reserved.