Class AbstractTemporalAccessorFormattingProcessor<T extends TemporalAccessor>
java.lang.Object
org.supercsv.cellprocessor.CellProcessorAdaptor
org.supercsv.cellprocessor.time.AbstractTemporalAccessorFormattingProcessor<T>
- All Implemented Interfaces:
CellProcessor
- Direct Known Subclasses:
FmtLocalDate, FmtLocalDateTime, FmtLocalTime, FmtZonedDateTime
public abstract class AbstractTemporalAccessorFormattingProcessor<T extends TemporalAccessor>
extends CellProcessorAdaptor
Abstract base class for cell processors converting
TemporalAccessor types to Strings.- Since:
- 2.4.0
-
Field Summary
FieldsFields inherited from class CellProcessorAdaptor
next -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String.Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String using the supplied formatter.AbstractTemporalAccessorFormattingProcessor(DateTimeFormatter formatter, CellProcessor next) Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String using the supplied formatter, then calls the next processor in the chain.Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String, then calls the next processor in the chain. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcheckPreconditions(DateTimeFormatter formatter) Checks the preconditions for creating a new AbstractTemporalAccessorFormattingProcessor processor.execute(Object value, CsvContext context) This method is invoked by the framework when the processor needs to process data or check constraints.getType()Methods inherited from class CellProcessorAdaptor
toString, validateInputNotNull
-
Field Details
-
formatter
-
-
Constructor Details
-
AbstractTemporalAccessorFormattingProcessor
public AbstractTemporalAccessorFormattingProcessor()Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String. -
AbstractTemporalAccessorFormattingProcessor
Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String, then calls the next processor in the chain.- Parameters:
next- next processor in the chain- Throws:
NullPointerException- if temporalAccessor or next is null
-
AbstractTemporalAccessorFormattingProcessor
Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String using the supplied formatter.- Parameters:
formatter- the formatter to use- Throws:
NullPointerException- if temporalAccessor or formatter is null
-
AbstractTemporalAccessorFormattingProcessor
Constructs a new AbstractTemporalAccessorFormattingProcessor processor, which formats the type as a String using the supplied formatter, then calls the next processor in the chain.- Parameters:
formatter- the formatter to usenext- the next processor in the chain- Throws:
NullPointerException- if temporalAccessor, formatter or next is null
-
-
Method Details
-
checkPreconditions
Checks the preconditions for creating a new AbstractTemporalAccessorFormattingProcessor processor.- Parameters:
formatter- the formatter- Throws:
NullPointerException- if temporalAccessor or formatter is null
-
execute
This method is invoked by the framework when the processor needs to process data or check constraints.- Parameters:
value- the value to be processedcontext- the CSV context- Returns:
- the result of cell processor execution
- Throws:
SuperCsvCellProcessorException- if value is null, not the correct type, or can't be formatted
-
getType
-