Package com.opencsv
Class CSVReaderBaseBuilder<T>
java.lang.Object
com.opencsv.CSVReaderBaseBuilder<T>
- Type Parameters:
T
- The type pf the CSVReader class to return
- Direct Known Subclasses:
CSVReaderBuilder
,CSVReaderHeaderAwareBuilder
Base class for the builders of various incarnations of CSVReaders.
- Since:
- 5.5.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract T
build()
Must create the CSVReader type requested.protected ICSVParser
Used by unit tests.protected int
Used by unit tests.protected ICSVParser
Creates a newICSVParser
if the class doesn't already hold one.protected Reader
Used by unit tests.protected int
Used by unit tests.boolean
protected boolean
Returns if the reader built will keep or discard carriage returns.
-
Field Details
-
reader
-
lineValidatorAggregator
-
rowValidatorAggregator
-
parserBuilder
-
skipLines
protected int skipLines -
icsvParser
-
keepCR
protected boolean keepCR -
verifyReader
protected boolean verifyReader -
nullFieldIndicator
-
multilineLimit
protected int multilineLimit -
errorLocale
-
rowProcessor
-
-
Constructor Details
-
CSVReaderBaseBuilder
Base Constructor- Parameters:
reader
- The reader to an underlying CSV source.
-
-
Method Details
-
getReader
Used by unit tests.- Returns:
- The reader.
-
getSkipLines
protected int getSkipLines()Used by unit tests.- Returns:
- The set number of lines to skip
-
getCsvParser
Used by unit tests.- Returns:
- The CSVParser used by the builder.
-
getMultilineLimit
protected int getMultilineLimit()Used by unit tests.- Returns:
- The upper limit on lines in multiline records.
-
keepCarriageReturn
protected boolean keepCarriageReturn()Returns if the reader built will keep or discard carriage returns.- Returns:
true
if the reader built will keep carriage returns,false
otherwise
-
getOrCreateCsvParser
Creates a newICSVParser
if the class doesn't already hold one.- Returns:
- The injected
ICSVParser
or a default parser.
-
isVerifyReader
public boolean isVerifyReader()- Returns:
- The flag indicating whether the reader should be verified before each read.
-
getErrorLocale
- Returns:
- The locale for error messages
-
getLineValidatorAggregator
- Returns:
- The
LineValidatorAggregator
for custom definedLineValidator
s.
-
getRowValidatorAggregator
- Returns:
- The
RowValidatorAggregator
for the custom definedRowValidator
s.
-
build
Must create the CSVReader type requested.- Returns:
- A new instance of
CSVReader
or derived class
-