public final class CsvParser extends ComputeIter<CsvRow> implements Closeable, Serializable
| Constructor and Description |
|---|
CsvParser(Reader reader,
CsvReadConfig config)
CSV解析器
|
CsvParser(Reader reader,
CsvReadConfig config,
int bufferSize)
CSV解析器
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected CsvRow |
computeNext() |
List<String> |
getHeader()
获取头部字段列表,如果headerLineNo < 0,抛出异常
|
CsvRow |
nextRow()
读取下一行数据
|
finish, hasNext, nextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic CsvParser(Reader reader, CsvReadConfig config)
reader - Readerconfig - 配置,null则为默认配置public CsvParser(Reader reader, CsvReadConfig config, int bufferSize)
reader - Readerconfig - 配置,null则为默认配置bufferSize - 默认缓存大小public List<String> getHeader()
IllegalStateException - 如果不解析头部或者没有调用nextRow()方法protected CsvRow computeNext()
computeNext in class ComputeIter<CsvRow>public CsvRow nextRow() throws IORuntimeException
IORuntimeException - IO读取异常public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2024. All rights reserved.