public final class CsvParser extends ComputeIter<CsvRow> implements Closeable, Serializable
| Constructor and Description |
|---|
CsvParser(Reader reader,
CsvReadConfig config)
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 List<String> getHeader()
IllegalStateException - 如果不解析头部或者没有调用nextRow()方法protected CsvRow computeNext()
ComputeItercomputeNext in class ComputeIter<CsvRow>public CsvRow nextRow() throws IORuntimeException
null表示IORuntimeException - IO读取异常public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2025. All rights reserved.