public class PropertyFormatterImpl extends java.lang.Object implements PropertyFormatter
PropertyFormatter
. This
class serves both as the default implementation if no
specific formatter is specified, and a base class which
can be subclassed to custom PropertyFormatters.
Created: April 27 2005
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Constructor and Description |
---|
PropertyFormatterImpl() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
format(java.lang.String pPropertyName,
java.lang.String pOutputPropertyName,
atg.repository.search.indexing.specifier.PropertyTypeEnum pType,
java.lang.Object pValue)
Format the specified text or meta property value.
|
java.lang.String |
formatMeta(java.lang.String pPropertyName,
java.lang.String pOutputPropertyName,
atg.repository.search.indexing.specifier.PropertyTypeEnum pType,
java.lang.Object pValue)
Format the specified meta property value.
|
java.lang.String |
formatText(java.lang.String pPropertyName,
java.lang.String pOutputPropertyName,
java.lang.Object pValue)
Format the specified text property value.
|
protected java.lang.String format(java.lang.String pPropertyName, java.lang.String pOutputPropertyName, atg.repository.search.indexing.specifier.PropertyTypeEnum pType, java.lang.Object pValue)
formatText(java.lang.String, java.lang.String, java.lang.Object)
and formatMeta(java.lang.String, java.lang.String, atg.repository.search.indexing.specifier.PropertyTypeEnum, java.lang.Object)
methods call through to this
method, so subclasses can simply override this method should
they will to change both behaviors. By default, pValue is converted to a string by invoking pValue.toString(). The only exceptoin is that if the pType is a date or an integer, it will attempt to invite Date.getTime() on date values, and Number.longValue() on numbers to try to extract numeric information.
pPropertyName
- the source name of the propertypOutputPropertyName
- the output property namepPropertyType
- the type of the meta property. Will be
UNKNOWN for text properties.pValue
- the property's valuepublic java.lang.String formatText(java.lang.String pPropertyName, java.lang.String pOutputPropertyName, java.lang.Object pValue)
formatText
in interface PropertyFormatter
pPropertyName
- the source name of the propertypOutputPropertyName
- the output property namepValue
- the property's valuepublic java.lang.String formatMeta(java.lang.String pPropertyName, java.lang.String pOutputPropertyName, atg.repository.search.indexing.specifier.PropertyTypeEnum pType, java.lang.Object pValue)
formatMeta
in interface PropertyFormatter
pPropertyName
- the source name of the propertypOutputPropertyName
- the output property namepType
- the type of the meta propertypValue
- the property's value