Package org.supercsv.cellprocessor.time
Class ParseZonedDateTime
- java.lang.Object
-
- org.supercsv.cellprocessor.CellProcessorAdaptor
-
- org.supercsv.cellprocessor.time.AbstractTemporalAccessorParsingProcessor<java.time.ZonedDateTime>
-
- org.supercsv.cellprocessor.time.ParseZonedDateTime
-
- All Implemented Interfaces:
CellProcessor
,StringCellProcessor
public class ParseZonedDateTime extends AbstractTemporalAccessorParsingProcessor<java.time.ZonedDateTime>
Converts a String to a ZonedDateTime. 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 org.supercsv.cellprocessor.CellProcessorAdaptor
next
-
-
Constructor Summary
Constructors Constructor Description ParseZonedDateTime()
Constructs a new ParseZonedDateTime processor, which parses a String in the same format accepted byZonedDateTime.parse(CharSequence)
as a ZonedDateTime.ParseZonedDateTime(java.time.format.DateTimeFormatter formatter)
Constructs a new ParseZonedDateTime processor, which parses a String as a ZonedDateTime using the supplied formatter.ParseZonedDateTime(java.time.format.DateTimeFormatter formatter, CellProcessor next)
Constructs a new ParseZonedDateTime processor, which parses a String as a ZonedDateTime using the supplied formatter, then calls the next processor in the chain.ParseZonedDateTime(CellProcessor next)
Constructs a new ParseZonedDateTime processor, which parses a String as a ZonedDateTime, then calls the next processor in the chain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.time.ZonedDateTime
parse(java.lang.String string)
Parses the String into the appropriateTemporalAccessor
type.protected java.time.ZonedDateTime
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
-
ParseZonedDateTime
public ParseZonedDateTime()
Constructs a new ParseZonedDateTime processor, which parses a String in the same format accepted byZonedDateTime.parse(CharSequence)
as a ZonedDateTime.
-
ParseZonedDateTime
public ParseZonedDateTime(CellProcessor next)
Constructs a new ParseZonedDateTime processor, which parses a String as a ZonedDateTime, then calls the next processor in the chain.- Parameters:
next
- the next processor in the chain- Throws:
java.lang.NullPointerException
- if next is null- See Also:
ParseZonedDateTime()
-
ParseZonedDateTime
public ParseZonedDateTime(java.time.format.DateTimeFormatter formatter)
Constructs a new ParseZonedDateTime processor, which parses a String as a ZonedDateTime using the supplied formatter.- Parameters:
formatter
- the formatter used for parsing- Throws:
java.lang.NullPointerException
- if formatter is null
-
ParseZonedDateTime
public ParseZonedDateTime(java.time.format.DateTimeFormatter formatter, CellProcessor next)
Constructs a new ParseZonedDateTime processor, which parses a String as a ZonedDateTime 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.ZonedDateTime parse(java.lang.String string)
Parses the String into the appropriateTemporalAccessor
type.- Specified by:
parse
in classAbstractTemporalAccessorParsingProcessor<java.time.ZonedDateTime>
- Parameters:
string
- the string to parse- Returns:
- the
TemporalAccessor
type
-
parse
protected java.time.ZonedDateTime 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.ZonedDateTime>
- Parameters:
string
- the string to parseformatter
- the formatter to use- Returns:
- the
TemporalAccessor
type
-
-