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

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

public class CoerceToDate
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 Date through the DateFormat.getDateInstance(int) method and the DateFormat.SHORT style.

Version:
$Id$
Author:
gvSIG Team

Constructor Summary
CoerceToDate()
           
 
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

CoerceToDate

public CoerceToDate()
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.