public final class CsvParser extends Object implements Closeable, Serializable
Constructor and Description |
---|
CsvParser(Reader reader,
CsvReadConfig config)
CSV解析器
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
List<String> |
getHeader()
获取头部字段列表,如果containsHeader设置为false则抛出异常
|
CsvRow |
nextRow()
读取下一行数据
|
public CsvParser(Reader reader, CsvReadConfig config)
reader
- Readerconfig
- 配置,null则为默认配置public List<String> getHeader()
IllegalStateException
- 如果不解析头部或者没有调用nextRow()方法public CsvRow nextRow() throws IORuntimeException
IORuntimeException
- IO读取异常public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2021. All rights reserved.