atg.projects.store.search
Class StorePriceMetaPropertyValueFormatter

java.lang.Object
  extended by atg.commerce.search.PriceMetaPropertyValueFormatter
      extended by atg.projects.store.search.StorePriceMetaPropertyValueFormatter
All Implemented Interfaces:
atg.repository.search.MetaPropertyValueFormatter

public class StorePriceMetaPropertyValueFormatter
extends atg.commerce.search.PriceMetaPropertyValueFormatter

Store enhancement of DCS price formatter. Store's formatter doesn't display fractional part of price (i.e. pennies) to user.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/Endeca/Index/src/atg/projects/store/search/StorePriceMetaPropertyValueFormatter.java#2 $$Change: 788983 $
Author:
ATG

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
StorePriceMetaPropertyValueFormatter()
           
 
Method Summary
 java.lang.String formatDisplayValue(atg.repository.search.MetaProperty pProperty, java.util.Locale pLocale, java.lang.String pValue)
          
protected  java.text.Format getCurrencyFormat(atg.repository.search.MetaProperty pProperty, java.util.Locale pLocale)
           Creates a Format instance to be used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values
Constructor Detail

StorePriceMetaPropertyValueFormatter

public StorePriceMetaPropertyValueFormatter()
Method Detail

formatDisplayValue

public java.lang.String formatDisplayValue(atg.repository.search.MetaProperty pProperty,
                                           java.util.Locale pLocale,
                                           java.lang.String pValue)

Specified by:
formatDisplayValue in interface atg.repository.search.MetaPropertyValueFormatter
Overrides:
formatDisplayValue in class atg.commerce.search.PriceMetaPropertyValueFormatter
Throws:
java.lang.NumberFormatException - - If wrong decimal value is passed through the pValue parameter.

getCurrencyFormat

protected java.text.Format getCurrencyFormat(atg.repository.search.MetaProperty pProperty,
                                             java.util.Locale pLocale)

Creates a Format instance to be used. This Format instance will be used by formatDisplayValue(MetaProperty, Locale, String) method to convert facet value returned by Search to the value displayed to user.

Override this method in order to define different price format for facets. If overridden, do not return null! This will cause the formatDisplayValue(MetaProperty, Locale, String) method to crash.

Parameters:
pProperty - - price meta-property
pLocale - - current locale; if this parameter is null, default Locale will be used.
Returns:
Format instance to be used when converting search price value to the displayable value.