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

public Class LocalTimeStringConverter

extends StringConverter<LocalTime>
Class Inheritance
Imports
java.time.LocalTime, java.time.format.DateTimeFormatter, .FormatStyle, java.util.Locale, javafx.util.StringConverter, javafx.util.converter.LocalDateTimeStringConverter.LdtConverter

StringConverter implementation for LocalTime values.

Since
JavaFX 8u40
See Also
LocalDateStringConverter, LocalDateTimeStringConverter

Field Summary

Modifier and TypeField and Description
pack-priv LocalDateTimeStringConverter.LdtConverter<LocalTime>

Constructor Summary

AccessConstructor and Description
public
LocalTimeStringConverter()

Create a StringConverter for LocalTime values, using a default formatter and parser with FormatStyle#SHORT, and the user's Locale.

public
LocalTimeStringConverter(FormatStyle
The FormatStyle that will be used by the default formatter and parser. If null then FormatStyle#SHORT will be used.
timeStyle
)

Create a StringConverter for LocalTime values, using a default formatter and parser with the specified FormatStyle and based on the user's Locale.

public
LocalTimeStringConverter(FormatStyle
The FormatStyle that will be used by the default formatter and parser. If null then FormatStyle#SHORT will be used.
timeStyle
,
Locale
The Locale that will be used by the default formatter and parser. If null then Locale.getDefault(Locale.Category.FORMAT) will be used.
locale
)

Create a StringConverter for LocalTime values, using a default formatter and parser with the specified FormatStyle and Locale.

public
LocalTimeStringConverter(DateTimeFormatter
An instance of DateTimeFormatter which will be used for formatting by the toString() method. If null then a default formatter will be used.
formatter
,
DateTimeFormatter
An instance of DateTimeFormatter which will be used for parsing by the fromString() method. This can be identical to formatter. If null, then formatter will be used, and if that is also null, then a default parser will be used.
parser
)

Create a StringConverter for LocalTime values using the supplied formatter and parser, which are responsible for choosing the desired Locale.

Method Summary

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

Implements abstract javafx.util.StringConverter.fromString.

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

public String
toString(LocalTime value)

Implements abstract javafx.util.StringConverter.toString.

Converts the object provided into its string form.

Field Detail

ldtConverterback to summary
pack-priv LocalDateTimeStringConverter.LdtConverter<LocalTime> ldtConverter

Constructor Detail

LocalTimeStringConverterback to summary
public LocalTimeStringConverter()

Create a StringConverter for LocalTime values, using a default formatter and parser with FormatStyle#SHORT, and the user's Locale.

LocalTimeStringConverterback to summary
public LocalTimeStringConverter(FormatStyle timeStyle)

Create a StringConverter for LocalTime values, using a default formatter and parser with the specified FormatStyle and based on the user's Locale.

Parameters
timeStyle:FormatStyle

The FormatStyle that will be used by the default formatter and parser. If null then FormatStyle#SHORT will be used.

LocalTimeStringConverterback to summary
public LocalTimeStringConverter(FormatStyle timeStyle, Locale locale)

Create a StringConverter for LocalTime values, using a default formatter and parser with the specified FormatStyle and Locale.

Parameters
timeStyle:FormatStyle

The FormatStyle that will be used by the default formatter and parser. If null then FormatStyle#SHORT will be used.

locale:Locale

The Locale that will be used by the default formatter and parser. If null then Locale.getDefault(Locale.Category.FORMAT) will be used.

LocalTimeStringConverterback to summary
public LocalTimeStringConverter(DateTimeFormatter formatter, DateTimeFormatter parser)

Create a StringConverter for LocalTime values using the supplied formatter and parser, which are responsible for choosing the desired Locale.

For example, a fixed pattern can be used for converting both ways:

String pattern = "HH:mm:ss";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
StringConverter<LocalTime> converter =
    DateTimeStringConverter.getLocalTimeConverter(formatter, null);
Parameters
formatter:DateTimeFormatter

An instance of DateTimeFormatter which will be used for formatting by the toString() method. If null then a default formatter will be used.

parser:DateTimeFormatter

An instance of DateTimeFormatter which will be used for parsing by the fromString() method. This can be identical to formatter. If null, then formatter will be used, and if that is also null, then a default parser will be used.

Method Detail

fromStringback to summary
public LocalTime 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
toStringback to summary
public String toString(LocalTime 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