com.endeca.portal.format
Class TimeFormatter

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

public class TimeFormatter
extends Formatter
implements TimeFormatSettings

Formatter for formatting Time 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.

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.TimeFormatSettings
TimeFormatSettings.TimeDisplayFormat
 
Nested classes/interfaces inherited from interface com.endeca.portal.format.FormatSettings
FormatSettings.Type
 
Field Summary
static TimeFormatSettings.TimeDisplayFormat DEFAULT_TIME_DISPLAY_FORMAT
          Predefined system default time display format
 
Fields inherited from class com.endeca.portal.format.Formatter
parentFormatSettings, type
 
Constructor Summary
TimeFormatter()
           
 
Method Summary
protected  void clearCachedJavaFormat()
           
protected  void createJavaFormat()
           
 java.lang.String format(java.util.Date rawDate)
           
 java.lang.String format(java.lang.String rawString)
           
protected  java.text.DateFormat getCachedJavaFormat()
           
 TimeFormatSettings.TimeDisplayFormat getMergedTimeDisplayFormat()
           
 TimeFormatSettings.TimeDisplayFormat getTimeDisplayFormat()
           
protected  void localeChanged()
          Subclasses can override this method to clear/reset some cached data that is dependent on locale, for example cached Java format.
protected  void parentFormatSettingsChanged()
          Subclasses can override this method to clear/reset some cached data that is dependent on parent format settings, for example cached Java format.
 void setTimeDisplayFormat(TimeFormatSettings.TimeDisplayFormat timeDisplayFormat)
           
 
Methods inherited from class com.endeca.portal.format.Formatter
getLocale, getParentFormatSettings, getType, loadResources, 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_TIME_DISPLAY_FORMAT

public static final TimeFormatSettings.TimeDisplayFormat DEFAULT_TIME_DISPLAY_FORMAT
Predefined system default time display format

Constructor Detail

TimeFormatter

public TimeFormatter()
Method Detail

getTimeDisplayFormat

public TimeFormatSettings.TimeDisplayFormat getTimeDisplayFormat()
Specified by:
getTimeDisplayFormat in interface TimeFormatSettings

setTimeDisplayFormat

public void setTimeDisplayFormat(TimeFormatSettings.TimeDisplayFormat timeDisplayFormat)

getMergedTimeDisplayFormat

public TimeFormatSettings.TimeDisplayFormat getMergedTimeDisplayFormat()
Specified by:
getMergedTimeDisplayFormat in interface TimeFormatSettings

getCachedJavaFormat

protected java.text.DateFormat getCachedJavaFormat()

clearCachedJavaFormat

protected void clearCachedJavaFormat()

createJavaFormat

protected void createJavaFormat()

localeChanged

protected void localeChanged()
Description copied from class: Formatter
Subclasses can override this method to clear/reset some cached data that is dependent on locale, for example cached Java format.

Overrides:
localeChanged in class Formatter

parentFormatSettingsChanged

protected void parentFormatSettingsChanged()
Description copied from class: Formatter
Subclasses can override this method to clear/reset some cached data that is dependent on parent format settings, for example cached Java format.

Overrides:
parentFormatSettingsChanged in class Formatter

format

public java.lang.String format(java.lang.String rawString)
                        throws Formatter.FormatParseException
Specified by:
format in class Formatter
Throws:
Formatter.FormatParseException

format

public java.lang.String format(java.util.Date rawDate)