public class DateTimeStringConverter extends StringConverter<Date>
StringConverter
implementation for Date
values that
represent a date and time.
DateStringConverter
,
TimeStringConverter
Modifier and Type | Field and Description |
---|---|
protected DateFormat |
dateFormat |
protected Locale |
locale |
protected String |
pattern |
Constructor and Description |
---|
DateTimeStringConverter() |
DateTimeStringConverter(DateFormat dateFormat) |
DateTimeStringConverter(Locale locale) |
DateTimeStringConverter(Locale locale,
String pattern) |
DateTimeStringConverter(String pattern) |
Modifier and Type | Method and Description |
---|---|
Date |
fromString(String value)
Converts the string provided into an object defined by the specific converter.
|
protected DateFormat |
getDateFormat()
Return a
DateFormat instance to use for formatting
and parsing in this StringConverter . |
String |
toString(Date value)
Converts the object provided into its string form.
|
protected final Locale locale
protected final String pattern
protected final DateFormat dateFormat
public DateTimeStringConverter()
public DateTimeStringConverter(Locale locale)
public DateTimeStringConverter(String pattern)
public DateTimeStringConverter(DateFormat dateFormat)
public Date fromString(String value)
fromString
in class StringConverter<Date>
public String toString(Date value)
toString
in class StringConverter<Date>
protected DateFormat getDateFormat()
Return a DateFormat
instance to use for formatting
and parsing in this StringConverter
.
Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.