Class LocalTimeStringConverter
A
StringConverter implementation for LocalTime values.- Since:
- JavaFX 8u40
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aLocalTimeStringConverterthat uses a formatter and parser based onFormatStyle.SHORT, and the user'sLocale.LocalTimeStringConverter(DateTimeFormatter formatter, DateTimeFormatter parser) Creates aLocalTimeStringConverterthat uses the given formatter and parser.LocalTimeStringConverter(FormatStyle timeStyle) Creates aLocalTimeStringConverterthat uses a formatter and parser based on the specifiedFormatStyleand the user'sLocale.LocalTimeStringConverter(FormatStyle timeStyle, Locale locale) Creates aLocalTimeStringConverterthat uses a formatter and parser based on the specifiedFormatStyleandLocale. -
Method Summary
-
Constructor Details
-
LocalTimeStringConverter
public LocalTimeStringConverter()Creates aLocalTimeStringConverterthat uses a formatter and parser based onFormatStyle.SHORT, and the user'sLocale. -
LocalTimeStringConverter
Creates aLocalTimeStringConverterthat uses a formatter and parser based on the specifiedFormatStyleand the user'sLocale.- Parameters:
timeStyle- theFormatStylethat will be used by the formatter and parser. Ifnull,FormatStyle.SHORTwill be used.
-
LocalTimeStringConverter
Creates aLocalTimeStringConverterthat uses a formatter and parser based on the specifiedFormatStyleandLocale.- Parameters:
timeStyle- TheFormatStylethat will be used by the formatter and parser. Ifnull,FormatStyle.SHORTwill be used.locale- theLocalethat will be used by the formatter and parser. Ifnull, the user's locale will be used.
-
LocalTimeStringConverter
Creates a
LocalTimeStringConverterthat uses the given formatter and parser.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- the formatter that will be used by thetoString()method. Ifnull, a default formatter will be used.parser- the parser that will be used by thefromString()method. This can be identical to formatter. Ifnull,formatterwill be used, and if that is alsonull, a default parser will be used.
-
-
Method Details
-
fromString
-
toString
Converts an object to a string form. The format of the returned string is defined by the specific converter.nullis converted to an empty string, otherwise the type'stoStringis used.- Parameters:
value- the object of typeTto convert- Returns:
- a string representation of the object passed in
-