Record
- the class used for a record, that is parsed from a CSV filepublic abstract class CsvParser<Record extends CsvRecord> extends Object implements Closeable
Modifier | Constructor and Description |
---|---|
protected |
CsvParser(org.apache.commons.csv.CSVParser parser)
Create with specifications of a
CSVParser . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the parser instance.
|
void |
closeQuietly()
Closes the parser instance without throwing exceptions.
|
long |
getCurrentLineNumber()
Returns the line number, that is currently processed by the parser.
|
long |
getRecordNumber()
Returns the total number of available records.
|
boolean |
hasNext()
Checks, if another record is available for the parser.
|
boolean |
isClosed()
Checks, if the parser instance was closed.
|
protected abstract Record |
newRecord(org.apache.commons.csv.CSVRecord record)
Creates a new
CsvRecord with parsed CSV data. |
Record |
next() |
protected CsvParser(org.apache.commons.csv.CSVParser parser)
CSVParser
.parser
- the CSV parser from
commons-csvpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if closing failedpublic final void closeQuietly()
public final long getCurrentLineNumber()
public final long getRecordNumber()
public final boolean hasNext()
public final boolean isClosed()
protected abstract Record newRecord(org.apache.commons.csv.CSVRecord record)
CsvRecord
with parsed CSV data.record
- parsed CSV data from
commons-csvpublic final Record next()
Copyright © 2015 OpenEstate. All rights reserved.