- java.lang.Object
- 
- javafx.util.StringConverter<LocalTime>
- 
- javafx.util.converter.LocalTimeStringConverter
 
 
- 
 public class LocalTimeStringConverter extends StringConverter<LocalTime> StringConverterimplementation forLocalTimevalues.- Since:
- JavaFX 8u40
- See Also:
- LocalDateStringConverter,- LocalDateTimeStringConverter
 
- 
- 
Constructor SummaryConstructors Constructor Description LocalTimeStringConverter()Create aStringConverterforLocalTimevalues, using a default formatter and parser withFormatStyle.SHORT, and the user'sLocale.LocalTimeStringConverter(DateTimeFormatter formatter, DateTimeFormatter parser)LocalTimeStringConverter(FormatStyle timeStyle)Create aStringConverterforLocalTimevalues, using a default formatter and parser with the specifiedFormatStyleand based on the user'sLocale.LocalTimeStringConverter(FormatStyle timeStyle, Locale locale)Create a StringConverter forLocalTimevalues, using a default formatter and parser with the specifiedFormatStyleandLocale.
 
- 
- 
- 
Constructor Detail- 
LocalTimeStringConverterpublic LocalTimeStringConverter() Create aStringConverterforLocalTimevalues, using a default formatter and parser withFormatStyle.SHORT, and the user'sLocale.
 - 
LocalTimeStringConverterpublic LocalTimeStringConverter(FormatStyle timeStyle) Create aStringConverterforLocalTimevalues, using a default formatter and parser with the specifiedFormatStyleand based on the user'sLocale.- Parameters:
- timeStyle- The- FormatStylethat will be used by the default formatter and parser. If null then- FormatStyle.SHORTwill be used.
 
 - 
LocalTimeStringConverterpublic LocalTimeStringConverter(FormatStyle timeStyle, Locale locale) Create a StringConverter forLocalTimevalues, using a default formatter and parser with the specifiedFormatStyleandLocale.- Parameters:
- timeStyle- The- FormatStylethat will be used by the default formatter and parser. If null then- FormatStyle.SHORTwill be used.
- locale- The- Localethat will be used by the default formatter and parser. If null then- Locale.getDefault(Locale.Category.FORMAT)will be used.
 
 - 
LocalTimeStringConverterpublic LocalTimeStringConverter(DateTimeFormatter formatter, DateTimeFormatter parser) Create a StringConverter forLocalTimevalues using the supplied formatter and parser, which are responsible for choosing the desiredLocale.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- An instance of- DateTimeFormatterwhich will be used for formatting by the toString() method. If null then a default formatter will be used.
- parser- An instance of- DateTimeFormatterwhich 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- 
fromStringpublic LocalTime fromString(String value) 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.- Specified by:
- fromStringin class- StringConverter<LocalTime>
- Parameters:
- value- the- Stringto convert
- Returns:
- an object representation of the string passed in.
 
 - 
toStringpublic String toString(LocalTime value) Converts the object provided into its string form. Format of the returned string is defined by the specific converter.- Specified by:
- toStringin class- StringConverter<LocalTime>
- Parameters:
- value- the object of type- Tto convert
- Returns:
- a string representation of the object passed in.
 
 
- 
 
-