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

public final Class StringArrayHandler

extends AbstractInternalCsvCallbackHandler<String[]>
Class Inheritance
Imports
java.util.Objects, java.util.function.Consumer

A CsvCallbackHandler implementation that returns the fields of each record as an array of Strings.

Example:

StringArrayHandler handler = StringArrayHandler.builder() .fieldModifier(FieldModifiers.TRIM) .build();
StringArrayHandler handler = StringArrayHandler.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
StringArrayHandler(final int maxFields, final int maxFieldSize, final int maxRecordSize, final FieldModifier fieldModifier)

Method Summary

Modifier and TypeMethod and Description
public static StringArrayHandler.StringArrayHandlerBuilder

Returns:

the builder
builder
()

Constructs a new builder instance for this class.

protected String[]
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 StringArrayHandler

Returns:

the new instance
of
()

Constructs a new instance of this class with default settings.

public static StringArrayHandler

Returns:

the new instance
of
(final Consumer<StringArrayHandler.StringArrayHandlerBuilder>
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

StringArrayHandlerback to summary
private StringArrayHandler(final int maxFields, final int maxFieldSize, final int maxRecordSize, final FieldModifier fieldModifier)

Method Detail

builderback to summary
public static StringArrayHandler.StringArrayHandlerBuilder builder()

Constructs a new builder instance for this class.

Returns:StringArrayHandler.StringArrayHandlerBuilder

the builder

See Also
of(Consumer)
buildRecordback to summary
protected String[] 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 StringArrayHandler of()

Constructs a new instance of this class with default settings.

Returns:StringArrayHandler

the new instance

See Also
StringArrayHandlerBuilder#build()
ofback to summary
public static StringArrayHandler of(final Consumer<StringArrayHandler.StringArrayHandlerBuilder> 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<StringArrayHandler.StringArrayHandlerBuilder>

the configuration, must not be null

Returns:StringArrayHandler

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 StringArrayHandler.StringArrayHandlerBuilder

extends AbstractInternalCsvCallbackHandler.AbstractInternalCsvCallbackHandlerBuilder<StringArrayHandler.StringArrayHandlerBuilder>
Class Inheritance

A builder for StringArrayHandler.

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 StringArrayHandler

Returns:

the new instance
build
()

Builds the StringArrayHandler instance.

protected StringArrayHandler.StringArrayHandlerBuilder
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

StringArrayHandlerBuilderback to summary
private StringArrayHandlerBuilder()

Method Detail

buildback to summary
public StringArrayHandler build()

Builds the StringArrayHandler instance.

Returns:StringArrayHandler

the new instance

Exceptions
IllegalArgumentException:
if argument constraints are violated (see AbstractInternalCsvCallbackHandler)
selfback to summary
protected StringArrayHandler.StringArrayHandlerBuilder 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