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

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

public class CoerceToTime
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 Time through the DateFormat.getTimeInstance(int) method and the DateFormat.MEDIUM style.

Version:
$Id$
Author:
gvSIG Team

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

CoerceToTime

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