@UsesJava8 public class InstantFormatter extends Object implements Formatter<Instant>
Formatter
implementation for a JSR-310 Instant
,
following JSR-310's parsing rules for an Instant (that is, not using a
configurable DateTimeFormatter
).Instant.parse(java.lang.CharSequence)
Constructor and Description |
---|
InstantFormatter() |
Modifier and Type | Method and Description |
---|---|
Instant |
parse(String text,
Locale locale)
Parse a text String to produce a T.
|
String |
print(Instant object,
Locale locale)
Print the object of type T for display.
|
public Instant parse(String text, Locale locale) throws ParseException
Parser
parse
in interface Parser<Instant>
text
- the text stringlocale
- the current user localeParseException
- when a parse exception occurs in a java.text parsing library