Spec-Zone.ru › OpenJavaFX 17

Class DateTimeStringConverter

java.lang.Object
javafx.util.StringConverter<Date>
javafx.util.converter.DateTimeStringConverter
Direct Known Subclasses:
DateStringConverter, TimeStringConverter
public class DateTimeStringConverter
extends StringConverter<Date>

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

Since:
JavaFX 2.1
See Also:
DateStringConverter, TimeStringConverter

Field Summary

Fields
Modifier and Type Field Description
protected DateFormat dateFormat
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.
protected int dateStyle
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.
protected Locale locale
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.
protected String pattern
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.
protected int timeStyle
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.

Constructor Summary

Constructors
Constructor Description
DateTimeStringConverter()
Create a StringConverter for Date values, using DateFormat.DEFAULT styles for date and time.
DateTimeStringConverter​(int dateStyle, int timeStyle)
Create a StringConverter for Date values, using specified DateFormat styles for date and time.
DateTimeStringConverter​(String pattern)
Create a StringConverter for Date values, using the specified pattern.
DateTimeStringConverter​(DateFormat dateFormat)
Create a StringConverter for Date values, using the specified DateFormat formatter.
DateTimeStringConverter​(Locale locale)
Create a StringConverter for Date values, using the specified locale and DateFormat.DEFAULT styles for date and time.
DateTimeStringConverter​(Locale locale, int dateStyle, int timeStyle)
Create a StringConverter for Date values, using specified locale and DateFormat styles for date and time.
DateTimeStringConverter​(Locale locale, String pattern)
Create a StringConverter for Date values, using the specified locale and pattern.

Method Summary

Modifier and Type Method Description
protected DateFormat getDateFormat()
Deprecated, for removal: This API element is subject to removal in a future version.
This method exposes internal implementation details and will be removed in a future version.

Methods declared in class javafx.util.StringConverter

fromString, toString

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

locale

@Deprecated(forRemoval=true, since="17") protected final Locale locale
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.

pattern

@Deprecated(forRemoval=true, since="17") protected final String pattern
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.

dateFormat

@Deprecated(forRemoval=true, since="17") protected final DateFormat dateFormat
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.

dateStyle

@Deprecated(forRemoval=true, since="17") protected final int dateStyle
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.
Since:
JavaFX 8u40

timeStyle

@Deprecated(forRemoval=true, since="17") protected final int timeStyle
Deprecated, for removal: This API element is subject to removal in a future version.
This field was exposed erroneously and will be removed in a future version.
Since:
JavaFX 8u40

Constructor Details

DateTimeStringConverter

public DateTimeStringConverter()
Create a StringConverter for Date values, using DateFormat.DEFAULT styles for date and time.

DateTimeStringConverter

public DateTimeStringConverter(int dateStyle, int timeStyle)
Create a StringConverter for Date values, using specified DateFormat styles for date and time.
Parameters:
dateStyle - the given formatting style. For example, DateFormat.SHORT for "M/d/yy" in the US locale.
timeStyle - the given formatting style. For example, DateFormat.SHORT for "h:mm a" in the US locale.
Since:
JavaFX 8u40

DateTimeStringConverter

public DateTimeStringConverter(Locale locale)
Create a StringConverter for Date values, using the specified locale and DateFormat.DEFAULT styles for date and time.
Parameters:
locale - the given locale.

DateTimeStringConverter

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 - the given locale.
dateStyle - the given formatting style. For example, DateFormat.SHORT for "M/d/yy" in the US locale.
timeStyle - the given formatting style. For example, DateFormat.SHORT for "h:mm a" in the US locale.
Since:
JavaFX 8u40

DateTimeStringConverter

public DateTimeStringConverter(String pattern)
Create a StringConverter for Date values, using the specified pattern.
Parameters:
pattern - the pattern describing the date and time format.

DateTimeStringConverter

public DateTimeStringConverter(Locale locale, String pattern)
Create a StringConverter for Date values, using the specified locale and pattern.
Parameters:
locale - the given locale.
pattern - the pattern describing the date and time format.

DateTimeStringConverter

public DateTimeStringConverter(DateFormat dateFormat)
Create a StringConverter for Date values, using the specified DateFormat formatter.
Parameters:
dateFormat - the DateFormat to be used for formatting and parsing.

Method Details

getDateFormat

@Deprecated(forRemoval=true, since="17") protected DateFormat getDateFormat()
Deprecated, for removal: This API element is subject to removal in a future version.
This method exposes internal implementation details and will be removed in a future version.

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

Returns:
a DateFormat instance for formatting and parsing in this StringConverter

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API