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 AbstractInternalCsvCallbackHandler
AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<T> -
Field Summary
Fields inherited from class AbstractInternalCsvCallbackHandler
fieldIdx, fieldModifier, fields, maxFields, maxFieldSize, maxRecordSize, recordSize, recordType, startingLineNumber -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance for this class.protected CsvRecordCalled at the end of each CSV record to build the actual record representation.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 AbstractInternalCsvCallbackHandler
addField, beginRecord, compactFields, getFieldCount, getRecordType, modifyComment, modifyField, setComment, setEmptyMethods inherited from class CsvCallbackHandler
terminate
-
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 the actual record representation.- Specified by:
buildRecordin classCsvCallbackHandler<CsvRecord>- Returns:
- the record or
nullif the record should be ignored/skipped as it is consumed by the callback handler.
-