Top Description Fields Constructors Methods
com.opencsv

public abstract Class CSVReaderBaseBuilder<T>

extends Object
Class Inheritance
Known Direct Subclasses
com.opencsv.CSVReaderBuilder, com.opencsv.CSVReaderHeaderAwareBuilder
Type Parameters
<T>
The type pf the CSVReader class to return
Imports
com.opencsv.enums.CSVReaderNullFieldIndicator, com.opencsv.processor.RowProcessor, com.opencsv.validators.LineValidatorAggregator, .RowValidatorAggregator, org.apache.commons.lang3.ObjectUtils, java.io.Reader, java.util.Locale

Base class for the builders of various incarnations of CSVReaders.
Author
Andrew Rucker Jones
Since
5.5.2

Field Summary

Modifier and TypeField and Description
protected Locale
protected ICSVParser
protected boolean
protected final LineValidatorAggregator
protected int
protected CSVReaderNullFieldIndicator
private final CSVParserBuilder
protected final Reader
protected RowProcessor
protected final RowValidatorAggregator
protected int
protected boolean

Constructor Summary

AccessConstructor and Description
protected
CSVReaderBaseBuilder(final Reader
The reader to an underlying CSV source.
reader
)

Base Constructor

Method Summary

Modifier and TypeMethod and Description
public abstract T

Returns:

A new instance of CSVReader or derived class
build
()

Must create the CSVReader type requested.

protected ICSVParser

Returns:

The CSVParser used by the builder.
getCsvParser
()

Used by unit tests.

public Locale
getErrorLocale()

Returns: The locale for error messages

public LineValidatorAggregator
protected int

Returns:

The upper limit on lines in multiline records.
getMultilineLimit
()

Used by unit tests.

protected ICSVParser

Returns:

The injected ICSVParser or a default parser.
getOrCreateCsvParser
()

Creates a new ICSVParser if the class doesn't already hold one.

protected Reader

Returns:

The reader.
getReader
()

Used by unit tests.

public RowValidatorAggregator
protected int

Returns:

The set number of lines to skip
getSkipLines
()

Used by unit tests.

public boolean
isVerifyReader()

Returns: The flag indicating whether the reader should be verified before each read.

protected boolean

Returns:

true if the reader built will keep carriage returns, false otherwise
keepCarriageReturn
()

Returns if the reader built will keep or discard carriage returns.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

errorLocaleback to summary
protected Locale errorLocale
icsvParserback to summary
protected ICSVParser icsvParser
keepCRback to summary
protected boolean keepCR
lineValidatorAggregatorback to summary
protected final LineValidatorAggregator lineValidatorAggregator
multilineLimitback to summary
protected int multilineLimit
nullFieldIndicatorback to summary
protected CSVReaderNullFieldIndicator nullFieldIndicator
parserBuilderback to summary
private final CSVParserBuilder parserBuilder
readerback to summary
protected final Reader reader
rowProcessorback to summary
protected RowProcessor rowProcessor
rowValidatorAggregatorback to summary
protected final RowValidatorAggregator rowValidatorAggregator
skipLinesback to summary
protected int skipLines
verifyReaderback to summary
protected boolean verifyReader

Constructor Detail

CSVReaderBaseBuilderback to summary
protected CSVReaderBaseBuilder(final Reader reader)

Base Constructor

Parameters
reader:Reader

The reader to an underlying CSV source.

Method Detail

buildback to summary
public abstract T build()

Must create the CSVReader type requested.

Returns:T

A new instance of CSVReader or derived class

getCsvParserback to summary
protected ICSVParser getCsvParser()

Used by unit tests.

Returns:ICSVParser

The CSVParser used by the builder.

getErrorLocaleback to summary
public Locale getErrorLocale()
Returns:Locale

The locale for error messages

getLineValidatorAggregatorback to summary
public LineValidatorAggregator getLineValidatorAggregator()
Returns:LineValidatorAggregator

The LineValidatorAggregator for custom defined com.opencsv.validators.LineValidators.

getMultilineLimitback to summary
protected int getMultilineLimit()

Used by unit tests.

Returns:int

The upper limit on lines in multiline records.

getOrCreateCsvParserback to summary
protected ICSVParser getOrCreateCsvParser()

Creates a new ICSVParser if the class doesn't already hold one.

Returns:ICSVParser

The injected ICSVParser or a default parser.

getReaderback to summary
protected Reader getReader()

Used by unit tests.

Returns:Reader

The reader.

getRowValidatorAggregatorback to summary
public RowValidatorAggregator getRowValidatorAggregator()
Returns:RowValidatorAggregator

The RowValidatorAggregator for the custom defined com.opencsv.validators.RowValidators.

getSkipLinesback to summary
protected int getSkipLines()

Used by unit tests.

Returns:int

The set number of lines to skip

isVerifyReaderback to summary
public boolean isVerifyReader()
Returns:boolean

The flag indicating whether the reader should be verified before each read.

keepCarriageReturnback to summary
protected boolean keepCarriageReturn()

Returns if the reader built will keep or discard carriage returns.

Returns:boolean

true if the reader built will keep carriage returns, false otherwise