public class DateStringConverter extends DateTimeStringConverter
StringConverter
implementation for Date
values.
TimeStringConverter
,
DateTimeStringConverter
dateFormat, dateStyle, locale, pattern, timeStyle
Constructor and Description |
---|
DateStringConverter()
|
DateStringConverter(DateFormat dateFormat)
|
DateStringConverter(int dateStyle)
|
DateStringConverter(Locale locale)
Create a
StringConverter for Date values, using the
specified locale and the DateFormat.DEFAULT date style. |
DateStringConverter(Locale locale,
int dateStyle)
|
DateStringConverter(Locale locale,
String pattern)
Create a
StringConverter for Date values, using the
specified locale and pattern. |
DateStringConverter(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 DateStringConverter()
public DateStringConverter(int dateStyle)
dateStyle
- the given formatting style. For example,
DateFormat.SHORT
for "M/d/yy" in the US locale.public DateStringConverter(Locale locale)
StringConverter
for Date
values, using the
specified locale and the DateFormat.DEFAULT
date style.locale
- the given locale.public DateStringConverter(Locale locale, int dateStyle)
locale
- the given locale.dateStyle
- the given formatting style. For example,
DateFormat.SHORT
for "M/d/yy" in the US locale.public DateStringConverter(String pattern)
StringConverter
for Date
values, using the
specified pattern.pattern
- the pattern describing the date format.public DateStringConverter(Locale locale, String pattern)
StringConverter
for Date
values, using the
specified locale and pattern.locale
- the given locale.pattern
- the pattern describing the date format.public DateStringConverter(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, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.