|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.converter.basic.AbstractBasicConverter
org.compass.core.converter.basic.AbstractFormatConverter
public abstract class AbstractFormatConverter
A base class that can handle ThreadSafeFormat and provide formatting support.
The format is read from a configuration setting CompassEnvironment.Converter.Format#FORMAT.
Uses a pool of formatters for better performance, using CompassEnvironment.Converter.Format#MIN_POOL_SIZE,
and CompassEnvironment.Converter.Format#MAX_POOL_SIZE as configuration settings for the pool size.
If specific locale is required for the formatted, the CompassEnvironment.Converter.Format#LOCALE can
be used to specify the required locale.
Allows to specify the default format if none is provided by overriding doGetDefaultFormat().
| Field Summary | |
|---|---|
protected Formatter[] |
formatters
|
protected boolean |
hasFormatter
|
protected Locale |
locale
|
| Constructor Summary | |
|---|---|
AbstractFormatConverter()
|
|
| Method Summary | |
|---|---|
boolean |
canNormalize()
Format based converters should can be used (and should) when using query parser notation. |
void |
configure(CompassSettings settings)
Configure using the given settings. |
FormatConverter |
copy()
Returns a copy of the format converter. |
protected abstract FormatterFactory |
doCreateFormatterFactory()
|
protected String |
doGetDefaultFormat()
|
void |
setFormat(String format)
Sets the format for the Converter. |
Property.Index |
suggestIndex()
Formattable types should usually be Property.Index.NOT_ANALYZED. |
| Methods inherited from class org.compass.core.converter.basic.AbstractBasicConverter |
|---|
createProperty, doFromString, doSetBoost, doToString, 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 |
|---|
protected Formatter[] formatters
protected boolean hasFormatter
protected Locale locale
| Constructor Detail |
|---|
public AbstractFormatConverter()
| Method Detail |
|---|
public void configure(CompassSettings settings)
throws CompassException
CompassConfigurable
configure in interface CompassConfigurablesettings - The settings for the configured object
CompassExceptionpublic void setFormat(String format)
FormatConverterConverter.
setFormat in interface FormatConverterpublic FormatConverter copy()
FormatConverter
copy in interface FormatConverterprotected abstract FormatterFactory doCreateFormatterFactory()
protected String doGetDefaultFormat()
public boolean canNormalize()
true.
canNormalize in interface ResourcePropertyConvertercanNormalize in class AbstractBasicConverterpublic Property.Index suggestIndex()
Property.Index.NOT_ANALYZED.
suggestIndex in interface ResourcePropertyConvertersuggestIndex in class AbstractBasicConverter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||