public final class EmptyDateFormat extends AbstractWrappedDateFormat
DateFormat and adds behavior to convert to/fro
the empty string. Therefore it holds an empty value that i
mapped to/from the empty string. The #format resul
of the empty value is the empty string, and the #parsenull but you can construct a
EmptyDateFormat with a given Date.Examples:
DateFormat.FielddelegateAM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD| Constructor and Description |
|---|
EmptyDateFormat(DateFormat delegate)
Constructs an
EmptyFormat that wraps the given mandatory forma
to convert null to the empty string and vice versa. |
EmptyDateFormat(DateFormat delegate,
Date emptyValue)
Constructs an
EmptyFormat that wraps the given mandatory forma
to convert the given emptyValue to the empty strin
and vice versa. |
| Modifier and Type | Method and Description |
|---|---|
StringBuffer |
format(Date date,
StringBuffer toAppendTo,
FieldPosition pos) |
Date |
parse(String source,
ParsePosition pos) |
formatToCharacterIterator, getCalendar, getNumberFormat, getTimeZone, isLenient, setCalendar, setLenient, setNumberFormat, setTimeZoneclone, equals, format, format, getAvailableLocales, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getTimeInstance, getTimeInstance, getTimeInstance, hashCode, parse, parseObjectformat, parseObjectpublic EmptyDateFormat(DateFormat delegate)
EmptyFormat that wraps the given mandatory forma
to convert null to the empty string and vice versa.delegate - the format that handles the standard casesNullPointerException - if delegate is nullpublic EmptyDateFormat(DateFormat delegate, Date emptyValue)
EmptyFormat that wraps the given mandatory forma
to convert the given emptyValue to the empty strin
and vice versa.delegate - the format that handles non-null valuesemptyValue - the representation of the empty stringNullPointerException - if delegate is nullpublic StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition pos)
format in class AbstractWrappedDateFormatpublic Date parse(String source, ParsePosition pos)
parse in class AbstractWrappedDateFormatCopyright © 2009-2014 JGoodies Software GmbH. All Rights Reserved.