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, next
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
public CsvParser(Reader reader, CsvReadConfig config)
reader
- Readerconfig
- 配置,null则为默认配置public List<String> getHeader()
IllegalStateException
- 如果不解析头部或者没有调用nextRow()方法protected CsvRow computeNext()
ComputeIter
computeNext
in class ComputeIter<CsvRow>
public CsvRow nextRow() throws IORuntimeException
IORuntimeException
- IO读取异常public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2024. All rights reserved.