Class ParseLocalTime
java.lang.Object
org.supercsv.cellprocessor.CellProcessorAdaptor
org.supercsv.cellprocessor.time.AbstractTemporalAccessorParsingProcessor<LocalTime>
org.supercsv.cellprocessor.time.ParseLocalTime
- All Implemented Interfaces:
CellProcessor, StringCellProcessor
Converts a String to a LocalTime.
For constructors using DateTimeFormatter, refer to the following
classes:
DateTimeFormatter- formats by pattern and styleDateTimeFormatter- ISO 8601 formatsDateTimeFormatterBuilder- complex formats created via method calls
- Since:
- 2.4.0
-
Field Summary
Fields inherited from class CellProcessorAdaptor
next -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ParseLocalTime processor, which parses a String as a LocalTime, accepting the same format asLocalTime.parse(CharSequence)ParseLocalTime(DateTimeFormatter formatter) Constructs a new ParseLocalTime processor, which parses a String as a LocalTime using the supplied formatter.ParseLocalTime(DateTimeFormatter formatter, CellProcessor next) Constructs a new ParseLocalTime processor, which parses a String as a LocalTime using the supplied formatter, then calls the next processor in the chain.ParseLocalTime(CellProcessor next) Constructs a new ParseLocalTime processor, which parses a String as a LocalTime, then calls the next processor in the chain. -
Method Summary
Modifier and TypeMethodDescriptionprotected LocalTimeParses the String into the appropriateTemporalAccessortype.protected LocalTimeparse(String string, DateTimeFormatter formatter) Parses the String into the appropriateTemporalAccessortype, using the supplied formatter.Methods inherited from class AbstractTemporalAccessorParsingProcessor
executeMethods inherited from class CellProcessorAdaptor
toString, validateInputNotNull
-
Constructor Details
-
ParseLocalTime
public ParseLocalTime()Constructs a new ParseLocalTime processor, which parses a String as a LocalTime, accepting the same format asLocalTime.parse(CharSequence) -
ParseLocalTime
Constructs a new ParseLocalTime processor, which parses a String as a LocalTime, then calls the next processor in the chain.- Parameters:
next- the next processor in the chain- Throws:
NullPointerException- if next is null- See Also:
-
ParseLocalTime
Constructs a new ParseLocalTime processor, which parses a String as a LocalTime using the supplied formatter.- Parameters:
formatter- the formatter used for parsing- Throws:
NullPointerException- if formatter is null
-
ParseLocalTime
Constructs a new ParseLocalTime processor, which parses a String as a LocalTime using the supplied formatter, then calls the next processor in the chain.- Parameters:
formatter- the formatter used for parsingnext- the next processor in the chain- Throws:
NullPointerException- if formatter or next is null
-
-
Method Details
-
parse
Parses the String into the appropriateTemporalAccessortype.- Specified by:
parsein classAbstractTemporalAccessorParsingProcessor<LocalTime>- Parameters:
string- the string to parse- Returns:
- the
TemporalAccessortype
-
parse
Parses the String into the appropriateTemporalAccessortype, using the supplied formatter.- Specified by:
parsein classAbstractTemporalAccessorParsingProcessor<LocalTime>- Parameters:
string- the string to parseformatter- the formatter to use- Returns:
- the
TemporalAccessortype
-