Interface DateBox.Format
-
- All Known Implementing Classes:
DateBox.DefaultFormat
- Enclosing class:
- DateBox
public static interface DateBox.FormatImplemented by a delegate to handle the parsing and formating of date values. The defaultDateBox.Formatuses a newDateBox.DefaultFormatinstance.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringformat(DateBox dateBox, java.util.Date date)Formats the provided date.java.util.Dateparse(DateBox dateBox, java.lang.String text, boolean reportError)Parses the provided string as a date.voidreset(DateBox dateBox, boolean abandon)If the format did any modifications to the date box's styling, reset them now.
-
-
-
Method Detail
-
format
java.lang.String format(DateBox dateBox, java.util.Date date)
Formats the provided date. Note, a null date is a possible input.- Parameters:
dateBox- the date box you are formattingdate- the date to format- Returns:
- the formatted date as a string
-
parse
java.util.Date parse(DateBox dateBox, java.lang.String text, boolean reportError)
Parses the provided string as a date.- Parameters:
dateBox- the date boxtext- the string representing a datereportError- should the formatter indicate a parse error to the user?- Returns:
- the date created, or null if there was a parse error
-
reset
void reset(DateBox dateBox, boolean abandon)
If the format did any modifications to the date box's styling, reset them now.- Parameters:
abandon- true when the current format is being replaced by anotherdateBox- the date box
-
-