Top Description Inners Fields Constructors Methods
de.siegmar.fastcsv.reader

public final Class CsvRecordHandler

extends AbstractInternalCsvCallbackHandler<CsvRecord>
Class Inheritance
Imports
java.util.Objects, java.util.function.Consumer

A CsvCallbackHandler implementation that returns a CsvRecord for each record.

Example:

CsvRecordHandler handler = CsvRecordHandler.builder() .fieldModifier(FieldModifiers.TRIM) .build();
CsvRecordHandler handler = CsvRecordHandler.builder()
    .fieldModifier(FieldModifiers.TRIM)
    .build();

This implementation is stateful and must not be reused.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Inherited from de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler:
fieldIdxfieldModifierfieldsmaxFieldsmaxFieldSizemaxRecordSizerecordSizerecordTypestartingLineNumber

Constructor Summary

AccessConstructor and Description
private
CsvRecordHandler(final int maxFields, final int maxFieldSize, final int maxRecordSize, final FieldModifier fieldModifier)

Method Summary

Modifier and TypeMethod and Description
public static CsvRecordHandler.CsvRecordHandlerBuilder

Returns:

the builder
builder
()

Constructs a new builder instance for this class.

protected CsvRecord
buildRecord()

Implements abstract de.siegmar.fastcsv.reader.CsvCallbackHandler.buildRecord.

Called at the end of each CSV record to build the actual record representation.

public static CsvRecordHandler

Returns:

the new instance
of
()

Constructs a new instance of this class with default settings.

public static CsvRecordHandler

Returns:

the new instance
of
(final Consumer<CsvRecordHandler.CsvRecordHandlerBuilder>
the configuration, must not be null
configurer
)

Constructs a new instance of this class with the given configuration.

Inherited from de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler:
addFieldbeginRecordcompactFieldsgetFieldCountgetRecordTypemodifyCommentmodifyFieldsetCommentsetEmpty

Constructor Detail

CsvRecordHandlerback to summary
private CsvRecordHandler(final int maxFields, final int maxFieldSize, final int maxRecordSize, final FieldModifier fieldModifier)

Method Detail

builderback to summary
public static CsvRecordHandler.CsvRecordHandlerBuilder builder()

Constructs a new builder instance for this class.

Returns:CsvRecordHandler.CsvRecordHandlerBuilder

the builder

See Also
of(Consumer)
buildRecordback to summary
protected CsvRecord buildRecord()

Implements abstract de.siegmar.fastcsv.reader.CsvCallbackHandler.buildRecord.

Doc from de.siegmar.fastcsv.reader.CsvCallbackHandler.buildRecord.

Called at the end of each CSV record to build the actual record representation.

Annotations
@Override
ofback to summary
public static CsvRecordHandler of()

Constructs a new instance of this class with default settings.

Returns:CsvRecordHandler

the new instance

See Also
CsvRecordHandlerBuilder#build()
ofback to summary
public static CsvRecordHandler of(final Consumer<CsvRecordHandler.CsvRecordHandlerBuilder> configurer)

Constructs a new instance of this class with the given configuration.

This is an alternative to the builder pattern for convenience.

Parameters
configurer:Consumer<CsvRecordHandler.CsvRecordHandlerBuilder>

the configuration, must not be null

Returns:CsvRecordHandler

the new instance

Exceptions
NullPointerException:
if null is passed
IllegalArgumentException:
if argument constraints are violated
See Also
builder()
de.siegmar.fastcsv.reader back to summary

public final Class CsvRecordHandler.CsvRecordHandlerBuilder

extends AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<CsvRecordHandler.CsvRecordHandlerBuilder>
Class Inheritance

A builder for CsvRecordHandler.

Field Summary

Inherited from de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder:
fieldModifiermaxFieldsmaxFieldSizemaxRecordSize

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public CsvRecordHandler

Returns:

the new instance
build
()

Builds the CsvRecordHandler instance.

protected CsvRecordHandler.CsvRecordHandlerBuilder
self()

Implements abstract de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder.self.

Method to be implemented by subclasses to return the correct type.

Inherited from de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder:
fieldModifiermaxFieldsmaxFieldSizemaxRecordSize

Constructor Detail

CsvRecordHandlerBuilderback to summary
private CsvRecordHandlerBuilder()

Method Detail

buildback to summary
public CsvRecordHandler build()

Builds the CsvRecordHandler instance.

Returns:CsvRecordHandler

the new instance

Exceptions
IllegalArgumentException:
if argument constraints are violated (see AbstractInternalCsvCallbackHandler)
selfback to summary
protected CsvRecordHandler.CsvRecordHandlerBuilder self()

Implements abstract de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder.self.

Doc from de.siegmar.fastcsv.reader.AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder.self.

Method to be implemented by subclasses to return the correct type.

Annotations
@Override