org.compass.core.converter.extended
Class DataTimeConverter

java.lang.Object
  extended by org.compass.core.converter.basic.AbstractBasicConverter<T>
      extended by org.compass.core.converter.basic.AbstractFormatConverter
          extended by org.compass.core.converter.extended.DataTimeConverter
All Implemented Interfaces:
CompassConfigurable, FormatConverter, Converter, ContextResourcePropertyConverter, ResourcePropertyConverter

public class DataTimeConverter
extends AbstractFormatConverter

A converter for Joda DateTime. The default format is the ISO format.

Author:
kimchy

Field Summary
static String DEFAULT_NOW_PREFIX
           
static String ISO
           
 
Fields inherited from class org.compass.core.converter.basic.AbstractFormatConverter
formatters, hasFormatter, locale
 
Constructor Summary
DataTimeConverter()
           
 
Method Summary
protected  FormatterFactory doCreateFormatterFactory()
           
protected  Object doFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
          Override the from String in order to un-marshall the String back into its object representation.
protected  String doGetDefaultFormat()
           
protected  String doToString(Object o, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
          Allows to override to toString operation.
 
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
 

Field Detail

DEFAULT_NOW_PREFIX

public static final String DEFAULT_NOW_PREFIX
See Also:
Constant Field Values

ISO

public static final String ISO
See Also:
Constant Field Values
Constructor Detail

DataTimeConverter

public DataTimeConverter()
Method Detail

doCreateFormatterFactory

protected FormatterFactory doCreateFormatterFactory()
Specified by:
doCreateFormatterFactory in class AbstractFormatConverter

doGetDefaultFormat

protected String doGetDefaultFormat()
Overrides:
doGetDefaultFormat in class AbstractFormatConverter

doFromString

protected Object doFromString(String str,
                              ResourcePropertyMapping resourcePropertyMapping,
                              MarshallingContext context)
                       throws ConversionException
Description copied from class: AbstractBasicConverter
Override the from String in order to un-marshall the String back into its object representation.

Specified by:
doFromString in class AbstractBasicConverter
Throws:
ConversionException

doToString

protected String doToString(Object o,
                            ResourcePropertyMapping resourcePropertyMapping,
                            MarshallingContext context)
Description copied from class: AbstractBasicConverter
Allows to override to toString operation. Default implementation calls the object toString.

Note, the marshalling context might be null.

Overrides:
doToString in class AbstractBasicConverter


Copyright (c) 2004-2009 The Compass Project.