public class TimeStringConverter extends DateTimeStringConverter
StringConverter
implementation for Date
values that
represent time.
DateStringConverter
,
DateTimeStringConverter
dateFormat, dateStyle, locale, pattern, timeStyle
Modifier | Constructor and Description |
---|---|
|
TimeStringConverter()
Create a
StringConverter for Date values, using the
DateFormat.DEFAULT time style. |
|
TimeStringConverter(java.text.DateFormat dateFormat)
Create a
StringConverter for Date values, using the
specified DateFormat formatter. |
|
TimeStringConverter(int timeStyle)
Create a
StringConverter for Date values, using the
specified DateFormat time style. |
|
TimeStringConverter(java.util.Locale locale)
Create a
StringConverter for Date values, using the
specified locale and the DateFormat.DEFAULT time style. |
|
TimeStringConverter(java.util.Locale locale,
int timeStyle)
Create a
StringConverter for Date values, using the
specified locale and DateFormat time style. |
|
TimeStringConverter(java.util.Locale locale,
java.lang.String pattern)
Create a
StringConverter for Date values, using the
specified locale and pattern. |
private |
TimeStringConverter(java.util.Locale locale,
java.lang.String pattern,
java.text.DateFormat dateFormat,
int timeStyle) |
|
TimeStringConverter(java.lang.String pattern)
Create a
StringConverter for Date values, using the
specified pattern. |
Modifier and Type | Method and Description |
---|---|
protected java.text.DateFormat |
getDateFormat()
Return a
DateFormat instance to use for formatting
and parsing in this StringConverter . |
fromString, toString
public TimeStringConverter()
StringConverter
for Date
values, using the
DateFormat.DEFAULT
time style.public TimeStringConverter(int timeStyle)
StringConverter
for Date
values, using the
specified DateFormat
time style.timeStyle
- the given formatting style. For example,
DateFormat.SHORT
for "h:mm a" in the US locale.public TimeStringConverter(java.util.Locale locale)
StringConverter
for Date
values, using the
specified locale and the DateFormat.DEFAULT
time style.locale
- the given locale.public TimeStringConverter(java.util.Locale locale, int timeStyle)
StringConverter
for Date
values, using the
specified locale and DateFormat
time style.locale
- the given locale.timeStyle
- the given formatting style. For example,
DateFormat.SHORT
for "h:mm a" in the US locale.public TimeStringConverter(java.lang.String pattern)
StringConverter
for Date
values, using the
specified pattern.pattern
- the pattern describing the time format.public TimeStringConverter(java.util.Locale locale, java.lang.String pattern)
StringConverter
for Date
values, using the
specified locale and pattern.locale
- the given locale.pattern
- the pattern describing the time format.public TimeStringConverter(java.text.DateFormat dateFormat)
StringConverter
for Date
values, using the
specified DateFormat
formatter.dateFormat
- the DateFormat
to be used for formatting and
parsing.private TimeStringConverter(java.util.Locale locale, java.lang.String pattern, java.text.DateFormat dateFormat, int timeStyle)
protected java.text.DateFormat getDateFormat()
Return a DateFormat
instance to use for formatting
and parsing in this StringConverter
.
getDateFormat
in class DateTimeStringConverter
DateFormat
instance for formatting and parsing in this
StringConverter