APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.util.converter

public Class DateTimeStringConverter

extends StringConverter<Date>
Class Inheritance
Known Direct Subclasses
javafx.util.converter.TimeStringConverter, javafx.util.converter.DateStringConverter
Imports
java.text.DateFormat, .ParseException, .SimpleDateFormat, java.util.Date, .Locale, javafx.util.StringConverter

StringConverter implementation for Date values that represent a date and time.

Since
JavaFX 2.1
See Also
DateStringConverter, TimeStringConverter

Field Summary

Modifier and TypeField and Description
pack-priv final DateFormat
pack-priv final int
pack-priv final Locale
pack-priv final String
pack-priv final int

Constructor Summary

AccessConstructor and Description
public
DateTimeStringConverter()

Create a StringConverter for Date values, using DateFormat#DEFAULT styles for date and time.

public
DateTimeStringConverter(int
the given formatting style. For example, DateFormat#SHORT for "M/d/yy" in the US locale.
dateStyle
,
int
the given formatting style. For example, DateFormat#SHORT for "h:mm a" in the US locale.
timeStyle
)

Create a StringConverter for Date values, using specified DateFormat styles for date and time.

public
DateTimeStringConverter(Locale
the given locale.
locale
)

Create a StringConverter for Date values, using the specified locale and DateFormat#DEFAULT styles for date and time.

public
DateTimeStringConverter(Locale
the given locale.
locale
,
int
the given formatting style. For example, DateFormat#SHORT for "M/d/yy" in the US locale.
dateStyle
,
int
the given formatting style. For example, DateFormat#SHORT for "h:mm a" in the US locale.
timeStyle
)

Create a StringConverter for Date values, using specified locale and DateFormat styles for date and time.

public
DateTimeStringConverter(String
the pattern describing the date and time format.
pattern
)

Create a StringConverter for Date values, using the specified pattern.

public
DateTimeStringConverter(Locale
the given locale.
locale
,
String
the pattern describing the date and time format.
pattern
)

Create a StringConverter for Date values, using the specified locale and pattern.

public
DateTimeStringConverter(DateFormat
the DateFormat to be used for formatting and parsing.
dateFormat
)

Create a StringConverter for Date values, using the specified DateFormat formatter.

pack-priv
DateTimeStringConverter(Locale locale, String pattern, DateFormat dateFormat, int dateStyle, int timeStyle)

Method Summary

Modifier and TypeMethod and Description
public Date
fromString(String value)

Implements abstract javafx.util.StringConverter.fromString.

Converts the string provided into an object defined by the specific converter.

pack-priv DateFormat

Returns:

a DateFormat instance for formatting and parsing in this StringConverter
getDateFormat
()

Returns a DateFormat instance to use for formatting and parsing in this StringConverter.

public String
toString(Date value)

Implements abstract javafx.util.StringConverter.toString.

Converts the object provided into its string form.

Field Detail

dateFormatback to summary
pack-priv final DateFormat dateFormat
dateStyleback to summary
pack-priv final int dateStyle
localeback to summary
pack-priv final Locale locale
patternback to summary
pack-priv final String pattern
timeStyleback to summary
pack-priv final int timeStyle

Constructor Detail

DateTimeStringConverterback to summary
public DateTimeStringConverter()

Create a StringConverter for Date values, using DateFormat#DEFAULT styles for date and time.

DateTimeStringConverterback to summary
public DateTimeStringConverter(int dateStyle, int timeStyle)

Create a StringConverter for Date values, using specified DateFormat styles for date and time.

Parameters
dateStyle:int

the given formatting style. For example, DateFormat#SHORT for "M/d/yy" in the US locale.

timeStyle:int

the given formatting style. For example, DateFormat#SHORT for "h:mm a" in the US locale.

Since
JavaFX 8u40
DateTimeStringConverterback to summary
public DateTimeStringConverter(Locale locale)

Create a StringConverter for Date values, using the specified locale and DateFormat#DEFAULT styles for date and time.

Parameters
locale:Locale

the given locale.

DateTimeStringConverterback to summary
public DateTimeStringConverter(Locale locale, int dateStyle, int timeStyle)

Create a StringConverter for Date values, using specified locale and DateFormat styles for date and time.

Parameters
locale:Locale

the given locale.

dateStyle:int

the given formatting style. For example, DateFormat#SHORT for "M/d/yy" in the US locale.

timeStyle:int

the given formatting style. For example, DateFormat#SHORT for "h:mm a" in the US locale.

Since
JavaFX 8u40
DateTimeStringConverterback to summary
public DateTimeStringConverter(String pattern)

Create a StringConverter for Date values, using the specified pattern.

Parameters
pattern:String

the pattern describing the date and time format.

DateTimeStringConverterback to summary
public DateTimeStringConverter(Locale locale, String pattern)

Create a StringConverter for Date values, using the specified locale and pattern.

Parameters
locale:Locale

the given locale.

pattern:String

the pattern describing the date and time format.

DateTimeStringConverterback to summary
public DateTimeStringConverter(DateFormat dateFormat)

Create a StringConverter for Date values, using the specified DateFormat formatter.

Parameters
dateFormat:DateFormat

the DateFormat to be used for formatting and parsing.

DateTimeStringConverterback to summary
pack-priv DateTimeStringConverter(Locale locale, String pattern, DateFormat dateFormat, int dateStyle, int timeStyle)

Method Detail

fromStringback to summary
public Date fromString(String value)

Implements abstract javafx.util.StringConverter.fromString.

Doc from javafx.util.StringConverter.fromString.

Converts the string provided into an object defined by the specific converter. Format of the string and type of the resulting object is defined by the specific converter.

Annotations
@Override
getDateFormatback to summary
pack-priv DateFormat getDateFormat()

Returns a DateFormat instance to use for formatting and parsing in this StringConverter.

Returns:DateFormat

a DateFormat instance for formatting and parsing in this StringConverter

toStringback to summary
public String toString(Date value)

Implements abstract javafx.util.StringConverter.toString.

Doc from javafx.util.StringConverter.toString.

Converts the object provided into its string form. Format of the returned string is defined by the specific converter.

Annotations
@Override