public class TimeStringConverter extends DateTimeStringConverter
StringConverter
implementation for Date
values that
represent time.
DateStringConverter
,
DateTimeStringConverter
dateFormat, 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, toString
public 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 DateTimeStringConverter
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.