Class CsvRecordHandler
java.lang.Object
de.siegmar.fastcsv.reader.CsvCallbackHandler<CsvRecord>
de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler<CsvRecord>
de.siegmar.fastcsv.reader.CsvRecordHandler
A CsvCallbackHandler implementation that returns a CsvRecord for each record.
Example:
CsvRecordHandler handler = CsvRecordHandler.builder()
.fieldModifier(FieldModifiers.TRIM)
.build();
This implementation is stateful and must not be reused.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler
AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<T extends AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<?>> -
Field Summary
Fields inherited from class de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler
comment, emptyLine, fieldIdx, fieldModifier, fields, maxFields, maxFieldSize, maxRecordSize, recordSize, startingLineNumber -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.CsvRecordHandler(FieldModifier fieldModifier) Deprecated, for removal: This API element is subject to removal in a future version.Usebuilder()orof(Consumer)instead. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance for this class.protected RecordWrapper<CsvRecord> Called at the end of each CSV record to build an object representation of the record.static CsvRecordHandlerof()Constructs a new instance of this class with default settings.static CsvRecordHandlerof(Consumer<CsvRecordHandler.CsvRecordHandlerBuilder> configurer) Constructs a new instance of this class with the given configuration.Methods inherited from class de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler
addField, beginRecord, buildWrapper, compactFields, modifyComment, modifyField, setCommentMethods inherited from class de.siegmar.fastcsv.reader.CsvCallbackHandler
terminate
-
Constructor Details
-
CsvRecordHandler
Deprecated, for removal: This API element is subject to removal in a future version.Useof()instead.Constructs a newCsvRecordHandler. -
CsvRecordHandler
Deprecated, for removal: This API element is subject to removal in a future version.Usebuilder()orof(Consumer)instead.Constructs a newCsvRecordHandlerwith the given field modifier.- Parameters:
fieldModifier- the field modifier, must not benull- Throws:
NullPointerException- ifnullis passed
-
-
Method Details
-
builder
Constructs a new builder instance for this class.- Returns:
- the builder
- See Also:
-
of
Constructs a new instance of this class with default settings.- Returns:
- the new instance
- See Also:
-
of
Constructs a new instance of this class with the given configuration.
This is an alternative to the builder pattern for convenience.
- Parameters:
configurer- the configuration, must not benull- Returns:
- the new instance
- Throws:
NullPointerException- ifnullis passedIllegalArgumentException- if argument constraints are violated- See Also:
-
buildRecord
Description copied from class:CsvCallbackHandlerCalled at the end of each CSV record to build an object representation of the record.
The returned wrapper is used by the
CsvReaderin order to determine how to process the record.- Specified by:
buildRecordin classCsvCallbackHandler<CsvRecord>- Returns:
- the record wrapper or
nullif the record should be ignored/skipped
-
of()instead.