public class TimeStringConverter extends DateTimeStringConverter
StringConverter implementation for Date values that
represent time.
DateStringConverter,
DateTimeStringConverterdateFormat, dateStyle, locale, pattern, timeStyle| Constructor and Description |
|---|
TimeStringConverter()
|
TimeStringConverter(DateFormat dateFormat)
|
TimeStringConverter(int timeStyle)
|
TimeStringConverter(Locale locale)
Create a
StringConverter for Date values, using the
specified locale and the DateFormat.DEFAULT time style. |
TimeStringConverter(Locale locale,
int timeStyle)
|
TimeStringConverter(Locale locale,
String pattern)
Create a
StringConverter for Date values, using the
specified locale and pattern. |
TimeStringConverter(String pattern)
Create a
StringConverter for Date values, using the
specified pattern. |
| Modifier and Type | Method and Description |
|---|---|
protected DateFormat |
getDateFormat()
Return a
DateFormat instance to use for formatting
and parsing in this StringConverter. |
fromString, toStringpublic TimeStringConverter()
public TimeStringConverter(int timeStyle)
timeStyle - the given formatting style. For example,
DateFormat.SHORT for "h:mm a" in the US locale.public TimeStringConverter(Locale locale)
StringConverter for Date values, using the
specified locale and the DateFormat.DEFAULT time style.locale - the given locale.public TimeStringConverter(Locale locale, int timeStyle)
locale - the given locale.timeStyle - the given formatting style. For example,
DateFormat.SHORT for "h:mm a" in the US locale.public TimeStringConverter(String pattern)
StringConverter for Date values, using the
specified pattern.pattern - the pattern describing the time format.public TimeStringConverter(Locale locale, 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(DateFormat dateFormat)
dateFormat - the DateFormat to be used for formatting and
parsing.protected DateFormat getDateFormat()
Return a DateFormat instance to use for formatting
and parsing in this StringConverter.
getDateFormat in class DateTimeStringConverterCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.