|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
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.
| Method Summary | |
java.lang.String |
format(java.util.Date date)
Format the date provided as a string. |
int |
getDateFormat()
Get the number of the date format used in this object. |
java.lang.String |
getDateTimeText()
Get how the date and time are used in the output. |
int |
getTimeFormat()
Get the number of the time format used in this object. |
java.util.Date |
parse(java.lang.String formatString)
Parse the given string to a date, using the current date format. |
void |
setDateFormat(int dateFormat)
Set the number of the date format used in this object. |
void |
setDateTimeText(java.lang.String dateTimeText)
Set this text to restrict the output to just date or just time, or to change the text between them. |
void |
setTimeFormat(int timeFormat)
Set the number of the time format used in this object. |
| Method Detail |
public java.lang.String format(java.util.Date date)
throws DateFormatterException
Format the date provided as a string.
date - the date to convert into a string.
DateFormatterException - if there is a problem creating the
string
because of an incorrect format pattern, for example.public int getDateFormat()
Get the number of the date format used in this object. This
should
correspond to one of the DATE_FORMAT_...
constants.
public java.lang.String getDateTimeText()
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.
public int getTimeFormat()
Get the number of the time format used in this object. This
should
correspond to one of the TIME_FORMAT_...
constants.
public java.util.Date parse(java.lang.String formatString)
throws java.text.ParseException,
DateFormatterException
Parse the given string to a date, using the current date format.
formatString - the string to convert into a date.
java.text.ParseException - if the string cannot be parsed into a
date object.
DateFormatterException - if the settings for this date format
are not set, or not set correctly
public void setDateFormat(int dateFormat)
throws DateFormatterException
Set the number of the date format used in this object. This
should
correspond to one of the DATE_FORMAT_...
constants.
dateFormat - the new value of the date format used.
DateFormatterException - if the settings for this date format
are not set, or not set correctly
public void setDateTimeText(java.lang.String dateTimeText)
throws DateFormatterException
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.
dateTimeText - the new value of the text used to combine date
and time
formats.
DateFormatterException - if the settings for this date format
are not set, or not set correctly
public void setTimeFormat(int timeFormat)
throws DateFormatterException
Set the number of the time format used in this object. This
should
correspond to one of the TIME_FORMAT_...
constants.
timeFormat - the new value of the time format used.
DateFormatterException - if the settings for this date format
are not set, or not set correctly
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||