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 newNamedCsvRecordHandler
with an empty header.NamedCsvRecordHandler
(FieldModifier fieldModifier) Constructs a newNamedCsvRecordHandler
with the given field modifier.NamedCsvRecordHandler
(FieldModifier fieldModifier, String... header) Constructs a newNamedCsvRecordHandler
with the given header and field modifier.NamedCsvRecordHandler
(FieldModifier fieldModifier, List<String> header) Constructs a newNamedCsvRecordHandler
with the given header and field modifier.NamedCsvRecordHandler
(String... header) Constructs a newNamedCsvRecordHandler
with the given header.NamedCsvRecordHandler
(List<String> header) Constructs a newNamedCsvRecordHandler
with 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 void
Methods inherited from class de.siegmar.fastcsv.reader.AbstractCsvCallbackHandler
addField, addField, beginRecord, buildWrapper, compactFields, materializeComment, materializeField, modifyComment, modifyField, setComment, setComment
Methods inherited from class de.siegmar.fastcsv.reader.CsvCallbackHandler
terminate
-
Field Details
-
EMPTY_HEADER
-
header
-
-
Constructor Details
-
NamedCsvRecordHandler
public NamedCsvRecordHandler()Constructs a newNamedCsvRecordHandler
with an empty header. -
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandler
with the given header.- Parameters:
header
- the header, must not benull
or containnull
elements- Throws:
NullPointerException
- ifnull
is passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandler
with the given header.- Parameters:
header
- the header, must not benull
or containnull
elements- Throws:
NullPointerException
- ifnull
is passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandler
with the given field modifier.- Parameters:
fieldModifier
- the field modifier, must not benull
- Throws:
NullPointerException
- ifnull
is passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandler
with the given header and field modifier.- Parameters:
fieldModifier
- the field modifier, must not benull
header
- the header, must not benull
or containnull
elements- Throws:
NullPointerException
- ifnull
is passed
-
NamedCsvRecordHandler
Constructs a newNamedCsvRecordHandler
with the given header and field modifier.- Parameters:
fieldModifier
- the field modifier, must not benull
header
- the header, must not benull
or containnull
elements- Throws:
NullPointerException
- ifnull
is passed
-
-
Method Details
-
setHeader
-
buildRecord
Description copied from class:CsvCallbackHandler
Called at the end of each CSV record to build an object representation of the record.The returned wrapper is used by the
CsvReader
in order to determine how to process the record.- Specified by:
buildRecord
in classCsvCallbackHandler<NamedCsvRecord>
- Returns:
- the record wrapper or
null
if the record should be ignored/skipped
-