Package org.supercsv.cellprocessor.time
Class ParseLocalDate
- java.lang.Object
-
- org.supercsv.cellprocessor.CellProcessorAdaptor
-
- org.supercsv.cellprocessor.time.AbstractTemporalAccessorParsingProcessor<java.time.LocalDate>
-
- org.supercsv.cellprocessor.time.ParseLocalDate
-
- All Implemented Interfaces:
CellProcessor
,StringCellProcessor
public class ParseLocalDate extends AbstractTemporalAccessorParsingProcessor<java.time.LocalDate>
Converts a String to a LocalDate.- Since:
- 2.4.0
-
-
Field Summary
-
Fields inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
next
-
-
Constructor Summary
Constructors Constructor Description ParseLocalDate()
Constructs a new ParseLocalDate processor, which parses a String recognised byLocalDate.parse(CharSequence)
as a LocalDate.ParseLocalDate(java.time.format.DateTimeFormatter formatter)
Constructs a new ParseLocalDate processor, which parses a String as a LocalDate using the supplied formatter.ParseLocalDate(java.time.format.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.time.LocalDate
parse(java.lang.String string)
Parses the String into the appropriateTemporalAccessor
type.protected java.time.LocalDate
parse(java.lang.String string, java.time.format.DateTimeFormatter formatter)
Parses the String into the appropriateTemporalAccessor
type, using the supplied formatter.-
Methods inherited from class org.supercsv.cellprocessor.time.AbstractTemporalAccessorParsingProcessor
execute
-
Methods inherited from class org.supercsv.cellprocessor.CellProcessorAdaptor
toString, validateInputNotNull
-
-
-
-
Constructor Detail
-
ParseLocalDate
public ParseLocalDate()
Constructs a new ParseLocalDate processor, which parses a String recognised byLocalDate.parse(CharSequence)
as a LocalDate.
-
ParseLocalDate
public 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.- Parameters:
next
- the next processor in the chain- Throws:
java.lang.NullPointerException
- if next is null
-
ParseLocalDate
public ParseLocalDate(java.time.format.DateTimeFormatter formatter)
Constructs a new ParseLocalDate processor, which parses a String as a LocalDate using the supplied formatter.- Parameters:
formatter
- the formatter used for parsing- Throws:
java.lang.NullPointerException
- if formatter is null
-
ParseLocalDate
public ParseLocalDate(java.time.format.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.- Parameters:
formatter
- the formatter used for parsingnext
- the next processor in the chain- Throws:
java.lang.NullPointerException
- if formatter or next is null
-
-
Method Detail
-
parse
protected java.time.LocalDate parse(java.lang.String string)
Parses the String into the appropriateTemporalAccessor
type.- Specified by:
parse
in classAbstractTemporalAccessorParsingProcessor<java.time.LocalDate>
- Parameters:
string
- the string to parse- Returns:
- the
TemporalAccessor
type
-
parse
protected java.time.LocalDate parse(java.lang.String string, java.time.format.DateTimeFormatter formatter)
Parses the String into the appropriateTemporalAccessor
type, using the supplied formatter.- Specified by:
parse
in classAbstractTemporalAccessorParsingProcessor<java.time.LocalDate>
- Parameters:
string
- the string to parseformatter
- the formatter to use- Returns:
- the
TemporalAccessor
type
-
-