org.compass.core.converter.extended
Class SqlDateConverter

java.lang.Object
  extended by org.compass.core.converter.basic.AbstractBasicConverter
      extended by org.compass.core.converter.basic.AbstractFormatConverter
          extended by org.compass.core.converter.basic.DateConverter
              extended by org.compass.core.converter.extended.SqlDateConverter
All Implemented Interfaces:
CompassConfigurable, FormatConverter, Converter, ResourcePropertyConverter

public class SqlDateConverter
extends DateConverter

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.core.converter.basic.DateConverter
DEFAULT_DATE_FORMAT, DEFAULT_NOW_PREFIX
 
Fields inherited from class org.compass.core.converter.basic.AbstractFormatConverter
formatters, hasFormatter, locale
 
Constructor Summary
SqlDateConverter()
           
 
Method Summary
protected  Object doFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
          Try all the configured formatters to format the str into an Object.
protected  String doGetDefaultFormat()
          Sql Timestamp has no default format, it uses the Time.toString().
protected  String doToString(Object o, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
          Uses the first configured formatter (also known as the default one) to convert it to String.
 
Methods inherited from class org.compass.core.converter.basic.DateConverter
doCreateFormatterFactory
 
Methods inherited from class org.compass.core.converter.basic.AbstractFormatConverter
canNormalize, configure, copy, setFormat, suggestIndex
 
Methods inherited from class org.compass.core.converter.basic.AbstractBasicConverter
createProperty, doSetBoost, fromString, fromString, getNullValue, handleNulls, isNullValue, marshall, suggestOmitNorms, suggestOmitTf, suggestStore, suggestTermVector, toString, toString, unmarshall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.core.converter.mapping.ResourcePropertyConverter
fromString, suggestOmitNorms, suggestOmitTf, suggestStore, suggestTermVector, toString
 
Methods inherited from interface org.compass.core.converter.Converter
marshall, unmarshall
 

Constructor Detail

SqlDateConverter

public SqlDateConverter()
Method Detail

doGetDefaultFormat

protected String doGetDefaultFormat()
Sql Timestamp has no default format, it uses the Time.toString().

Overrides:
doGetDefaultFormat in class DateConverter

doToString

protected String doToString(Object o,
                            ResourcePropertyMapping resourcePropertyMapping,
                            MarshallingContext context)
Description copied from class: DateConverter
Uses the first configured formatter (also known as the default one) to convert it to String.

Overrides:
doToString in class DateConverter

doFromString

protected Object doFromString(String str,
                              ResourcePropertyMapping resourcePropertyMapping,
                              MarshallingContext context)
                       throws ConversionException
Description copied from class: DateConverter
Try all the configured formatters to format the str into an Object.

Overrides:
doFromString in class DateConverter
Throws:
ConversionException


Copyright (c) 2004-2008 The Compass Project.