| com.ivata.mask.web.format.DateFormatter
DateFormatter | public interface DateFormatter (Code) | |
This interface defines a formatter which is used to parse dates in a standard
way, system-wide.
Note that ivata masks does not provide an implementation of
this interface. For an example implementation, look at the class
SettingDateFormatter in
ivata groupware.
since: ivata masks 0.5 (2005-01-11) author: Colin MacLeod author: colin.macleod@ivata.com version: $Revision: 1.2 $ |
Method Summary | |
String | format(Date date) Format the date provided as a string.
Parameters: date - the date to convert into a string. | int | getDateFormat() Get the number of the date format used in this object. | String | getDateTimeText() | int | getTimeFormat() Get the number of the time format used in this object. | Date | parse(String formatString) Parse the given string to a date, using the current date
format.
Parameters: formatString - the string to convert into a date. | void | setDateFormat(int dateFormat) Set the number of the date format used in this object. | void | setDateTimeText(String dateTimeText) | void | setTimeFormat(int timeFormat) Set the number of the time format used in this object. |
format | String format(Date date) throws DateFormatterException(Code) | | Format the date provided as a string.
Parameters: date - the date to convert into a string. date string, converted to a string, using the requestedformat. throws: DateFormatterException - if there is a problem creating thestringbecause of an incorrect format pattern, for example. |
getDateFormat | int getDateFormat()(Code) | | Get the number of the date format used in this object. This
should
correspond to one of the DATE_FORMAT_...
constants.
the current value of the date format used. |
getDateTimeText | String getDateTimeText()(Code) | | Get how the date and time are used in the output.
The format used is the same as the format for
java.text.MessageFormat and the string
{0} will be
replaced with the date format chosen, {1} is replaced
with the
time format chosen.
the current text used to combine date and time formats. |
getTimeFormat | int getTimeFormat()(Code) | | Get the number of the time format used in this object. This
should
correspond to one of the TIME_FORMAT_...
constants.
the current value of the time format used. |
setDateFormat | void setDateFormat(int dateFormat) throws DateFormatterException(Code) | | Set the number of the date format used in this object. This
should
correspond to one of the DATE_FORMAT_...
constants.
Parameters: dateFormat - the new value of the date format used. throws: DateFormatterException - if the settings for this date formatare not set, or not set correctly |
setDateTimeText | void setDateTimeText(String dateTimeText) throws DateFormatterException(Code) | | Set this text to restrict the output to just date or just time,
or to
change the text between
them.
The format used is the same as the format for
java.text.MessageFormat and the string
{0} will be
replaced with the date format chosen, {1} is replaced
with the
time format chosen.
Parameters: dateTimeText - the new value of the text used to combine dateand timeformats. throws: DateFormatterException - if the settings for this date formatare not set, or not set correctly |
setTimeFormat | void setTimeFormat(int timeFormat) throws DateFormatterException(Code) | | Set the number of the time format used in this object. This
should
correspond to one of the TIME_FORMAT_...
constants.
Parameters: timeFormat - the new value of the time format used. throws: DateFormatterException - if the settings for this date formatare not set, or not set correctly |
|
|