Package org.supercsv.cellprocessor.time
Class ParseLocalDate
java.lang.Object
org.supercsv.cellprocessor.CellProcessorAdaptor
org.supercsv.cellprocessor.time.AbstractTemporalAccessorParsingProcessor<LocalDate>
org.supercsv.cellprocessor.time.ParseLocalDate
- All Implemented Interfaces:
CellProcessor,StringCellProcessor
Converts a String to a LocalDate.
- Since:
- 2.4.0
-
Field Summary
Fields inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
next -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ParseLocalDate processor, which parses a String recognised byLocalDate.parse(CharSequence)as a LocalDate.ParseLocalDate(DateTimeFormatter formatter) Constructs a new ParseLocalDate processor, which parses a String as a LocalDate using the supplied formatter.ParseLocalDate(DateTimeFormatter formatter, CellProcessor next) Constructs a new ParseLocalDate processor, which parses a String as a LocalDate using the supplied formatter, then calls the next processor in the chain.ParseLocalDate(CellProcessor next) Constructs a new ParseLocalDate processor, which parses a String recognised byLocalDate.parse(CharSequence)as a LocalDate, then calls the next processor in the chain. -
Method Summary
Modifier and TypeMethodDescriptionprotected LocalDateParses the String into the appropriateTemporalAccessortype.protected LocalDateparse(String string, DateTimeFormatter formatter) Parses the String into the appropriateTemporalAccessortype, using the supplied formatter.Methods inherited from class org.supercsv.cellprocessor.time.AbstractTemporalAccessorParsingProcessor
executeMethods inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
toString, validateInputNotNull
-
Constructor Details
-
ParseLocalDate
public ParseLocalDate()Constructs a new ParseLocalDate processor, which parses a String recognised byLocalDate.parse(CharSequence)as a LocalDate. -
ParseLocalDate
Constructs a new ParseLocalDate processor, which parses a String recognised byLocalDate.parse(CharSequence)as a LocalDate, then calls the next processor in the chain.- Parameters:
next- the next processor in the chain- Throws:
NullPointerException- if next is null
-
ParseLocalDate
Constructs a new ParseLocalDate processor, which parses a String as a LocalDate using the supplied formatter.- Parameters:
formatter- the formatter used for parsing- Throws:
NullPointerException- if formatter is null
-
ParseLocalDate
Constructs a new ParseLocalDate processor, which parses a String as a LocalDate 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<LocalDate>- Parameters:
string- the string to parse- Returns:
- the
TemporalAccessortype
-
parse
Parses the String into the appropriateTemporalAccessortype, using the supplied formatter.- Specified by:
parsein classAbstractTemporalAccessorParsingProcessor<LocalDate>- Parameters:
string- the string to parseformatter- the formatter to use- Returns:
- the
TemporalAccessortype
-