com.endeca.portal.format
Class BooleanFormatter

java.lang.Object
  extended by com.endeca.portal.format.Formatter
      extended by com.endeca.portal.format.BooleanFormatter
All Implemented Interfaces:
BooleanFormatSettings, FormatSettings, java.io.Serializable

public class BooleanFormatter
extends Formatter
implements BooleanFormatSettings

Formatter for formatting Boolean type based on locale and format settings. If the value of a format setting is DEFAULT, the value of the format setting of its parent will be used if it is not DEFAULT. Otherwise, system default value of that format setting will be used. The default true/false values are locale sensitive, therefore the string resources are stored in a resource bundle. It is caller's responsibility to call setLocalizedDefaultValues() to pass in the localized resources.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.endeca.portal.format.Formatter
Formatter.FormatParseException
 
Nested classes/interfaces inherited from interface com.endeca.portal.format.BooleanFormatSettings
BooleanFormatSettings.DisplayOption
 
Nested classes/interfaces inherited from interface com.endeca.portal.format.FormatSettings
FormatSettings.Type
 
Field Summary
static BooleanFormatSettings.DisplayOption DEFAULT_DISPLAY_OPTION
           
 
Fields inherited from class com.endeca.portal.format.Formatter
parentFormatSettings, type
 
Constructor Summary
BooleanFormatter()
           
 
Method Summary
 java.lang.String format(boolean b)
          Format a boolean value
 java.lang.String format(java.lang.String s)
           
 java.lang.String getCustomFalseValue()
           
 java.lang.String getCustomTrueValue()
           
 BooleanFormatSettings.DisplayOption getDisplayOption()
           
 BooleanFormatSettings.DisplayOption getMergedDisplayOption()
           
 java.lang.String getMergedFalseValue()
           
 java.lang.String getMergedTrueValue()
           
protected  void loadResources(javax.portlet.PortletRequest request)
          Subclasses need to override this method to load resources when needed.
 void setCustomFalseValue(java.lang.String falseValue)
           
 void setCustomTrueValue(java.lang.String trueValue)
           
 void setDisplayOption(BooleanFormatSettings.DisplayOption displayOption)
           
 
Methods inherited from class com.endeca.portal.format.Formatter
getLocale, getParentFormatSettings, getType, localeChanged, parentFormatSettingsChanged, setLocale, setLocale, setParentFormatSettings, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.endeca.portal.format.FormatSettings
getType, toString
 

Field Detail

DEFAULT_DISPLAY_OPTION

public static final BooleanFormatSettings.DisplayOption DEFAULT_DISPLAY_OPTION
Constructor Detail

BooleanFormatter

public BooleanFormatter()
Method Detail

loadResources

protected void loadResources(javax.portlet.PortletRequest request)
Description copied from class: Formatter
Subclasses need to override this method to load resources when needed.

Overrides:
loadResources in class Formatter

getDisplayOption

public BooleanFormatSettings.DisplayOption getDisplayOption()
Specified by:
getDisplayOption in interface BooleanFormatSettings

setDisplayOption

public void setDisplayOption(BooleanFormatSettings.DisplayOption displayOption)

getMergedDisplayOption

public BooleanFormatSettings.DisplayOption getMergedDisplayOption()
Specified by:
getMergedDisplayOption in interface BooleanFormatSettings

getCustomTrueValue

public java.lang.String getCustomTrueValue()
Specified by:
getCustomTrueValue in interface BooleanFormatSettings

setCustomTrueValue

public void setCustomTrueValue(java.lang.String trueValue)

getMergedTrueValue

public java.lang.String getMergedTrueValue()
Specified by:
getMergedTrueValue in interface BooleanFormatSettings

getCustomFalseValue

public java.lang.String getCustomFalseValue()
Specified by:
getCustomFalseValue in interface BooleanFormatSettings

setCustomFalseValue

public void setCustomFalseValue(java.lang.String falseValue)

getMergedFalseValue

public java.lang.String getMergedFalseValue()
Specified by:
getMergedFalseValue in interface BooleanFormatSettings

format

public java.lang.String format(java.lang.String s)
Specified by:
format in class Formatter

format

public java.lang.String format(boolean b)
Format a boolean value