org.compass.core.converter.basic
Class AbstractNumberConverter
java.lang.Object
org.compass.core.converter.basic.AbstractBasicConverter
org.compass.core.converter.basic.AbstractFormatConverter
org.compass.core.converter.basic.AbstractNumberConverter
- All Implemented Interfaces:
- CompassConfigurable, FormatConverter, Converter, ResourcePropertyConverter
- Direct Known Subclasses:
- BigDecimalConverter, BigIntegerConverter, DoubleConverter, FloatConverter, IntConverter, LongConverter, ShortConverter
public abstract class AbstractNumberConverter
- extends AbstractFormatConverter
- implements CompassConfigurable
A base class for number based converters. Allows for formatting (if specified) and for default
behaviour handling if none is provided.
- Author:
- kimchy
| Methods inherited from class org.compass.core.converter.basic.AbstractBasicConverter |
createProperty, doSetBoost, fromString, fromString, getNullValue, handleNulls, isNullValue, marshall, toString, toString, unmarshall |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractNumberConverter
public AbstractNumberConverter()
doCreateFormatterFactory
protected ThreadSafeFormat.FormatterFactory doCreateFormatterFactory()
- Specified by:
doCreateFormatterFactory in class AbstractFormatConverter
defaultFromString
protected abstract Object defaultFromString(String str,
ResourcePropertyMapping resourcePropertyMapping)
fromNumber
protected abstract Object fromNumber(Number number)
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
defaultToString
protected String defaultToString(Object o,
ResourcePropertyMapping resourcePropertyMapping,
MarshallingContext context)
Copyright (c) 2004-2006 The Compass Project.