java.lang.Object
de.siegmar.fastcsv.reader.CsvCallbackHandler<NamedCsvRecord>
de.siegmar.fastcsv.reader.AbstractCsvCallbackHandler<NamedCsvRecord>
de.siegmar.fastcsv.reader.NamedCsvRecordHandler
A callback handler that returns a
NamedCsvRecord for each record.
This implementation is stateful and must not be reused.
-
Field Summary
FieldsFields inherited from class de.siegmar.fastcsv.reader.AbstractCsvCallbackHandler
comment, emptyLine, fieldIdx, fieldModifier, fields, recordSize, startingLineNumber -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newNamedCsvRecordHandlerwith an empty header.NamedCsvRecordHandler(FieldModifier fieldModifier) Constructs a newNamedCsvRecordHandlerwith the given field modifier.NamedCsvRecordHandler(FieldModifier fieldModifier, String... header) Constructs a newNamedCsvRecordHandlerwith the given header and field modifier.NamedCsvRecordHandler(FieldModifier fieldModifier, List<String> header) Constructs a newNamedCsvRecordHandlerwith the given header and field modifier.NamedCsvRecordHandler(String... header) Constructs a newNamedCsvRecordHandlerwith the given header.NamedCsvRecordHandler(List<String> header) Constructs a newNamedCsvRecordHandlerwith the given header. -
Method Summary
Modifier and TypeMethodDescriptionprotected RecordWrapper<NamedCsvRecord> Called at the end of each CSV record to build an object representation of the record.private voidMethods inherited from class de.siegmar.fastcsv.reader.AbstractCsvCallbackHandler
addField, addField, beginRecord, buildWrapper, compactFields, materializeComment, materializeField, modifyComment, modifyField, setComment, setCommentMethods inherited from class de.siegmar.fastcsv.reader.CsvCallbackHandler
terminate
-
Field Details
-
EMPTY_HEADER
-
header
-
-
Constructor Details
-
NamedCsvRecordHandler
public NamedCsvRecordHandler()Constructs a newNamedCsvRecordHandlerwith an empty header. -
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandlerwith the given header.- Parameters:
header- the header, must not benullor containnullelements- Throws:
NullPointerException- ifnullis passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandlerwith the given header.- Parameters:
header- the header, must not benullor containnullelements- Throws:
NullPointerException- ifnullis passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandlerwith the given field modifier.- Parameters:
fieldModifier- the field modifier, must not benull- Throws:
NullPointerException- ifnullis passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandlerwith the given header and field modifier.- Parameters:
fieldModifier- the field modifier, must not benullheader- the header, must not benullor containnullelements- Throws:
NullPointerException- ifnullis passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandlerwith the given header and field modifier.- Parameters:
fieldModifier- the field modifier, must not benullheader- the header, must not benullor containnullelements- Throws:
NullPointerException- ifnullis passed
-
-
Method Details
-
setHeader
-
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<NamedCsvRecord>- Returns:
- the record wrapper or
nullif the record should be ignored/skipped
-