com.endeca.portal.format
Class DateTimeFormatter
java.lang.Object
com.endeca.portal.format.Formatter
com.endeca.portal.format.DateTimeFormatter
- All Implemented Interfaces:
- DateTimeFormatSettings, FormatSettings, java.io.Serializable
public class DateTimeFormatter
- extends Formatter
- implements DateTimeFormatSettings
Formatter for formatting DateTime 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_DATE_DISPLAY_FORMAT
public static final DateTimeFormatSettings.DateDisplayFormat DEFAULT_DATE_DISPLAY_FORMAT
DEFAULT_TIME_DISPLAY_FORMAT
public static final DateTimeFormatSettings.TimeDisplayFormat DEFAULT_TIME_DISPLAY_FORMAT
DateTimeFormatter
public DateTimeFormatter()
getDateDisplayFormat
public DateTimeFormatSettings.DateDisplayFormat getDateDisplayFormat()
- Specified by:
getDateDisplayFormat in interface DateTimeFormatSettings
setDateDisplayFormat
public void setDateDisplayFormat(DateTimeFormatSettings.DateDisplayFormat dateDisplayFormat)
getMergedDateDisplayFormat
public DateTimeFormatSettings.DateDisplayFormat getMergedDateDisplayFormat()
- Specified by:
getMergedDateDisplayFormat in interface DateTimeFormatSettings
getTimeDisplayFormat
public DateTimeFormatSettings.TimeDisplayFormat getTimeDisplayFormat()
- Specified by:
getTimeDisplayFormat in interface DateTimeFormatSettings
setTimeDisplayFormat
public void setTimeDisplayFormat(DateTimeFormatSettings.TimeDisplayFormat timeDisplayFormat)
getMergedTimeDisplayFormat
public DateTimeFormatSettings.TimeDisplayFormat getMergedTimeDisplayFormat()
- Specified by:
getMergedTimeDisplayFormat in interface DateTimeFormatSettings
getCachedJavaFormat
protected java.text.DateFormat getCachedJavaFormat()
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
clearCachedJavaFormat
protected void clearCachedJavaFormat()
createJavaFormat
protected void createJavaFormat()
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)
toPattern
public java.lang.String toPattern()