Package org.miaixz.bus.office.csv
Class CsvParser
java.lang.Object
org.miaixz.bus.core.center.iterator.ComputeIterator<CsvRow>
org.miaixz.bus.office.csv.CsvParser
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable,Iterator<CsvRow>
public final class CsvParser
extends org.miaixz.bus.core.center.iterator.ComputeIterator<CsvRow>
implements Closeable, Serializable
CSV行解析器,参考:FastCSV
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.miaixz.bus.core.center.iterator.ComputeIterator
finish, hasNext, nextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
CsvParser
CSV解析器- Parameters:
reader- Readerconfig- 配置,null则为默认配置
-
-
Method Details
-
getHeader
获取头部字段列表,如果headerLineNo < 0,抛出异常- Returns:
- 头部列表
- Throws:
IllegalStateException- 如果不解析头部或者没有调用nextRow()方法
-
computeNext
- Specified by:
computeNextin classorg.miaixz.bus.core.center.iterator.ComputeIterator<CsvRow>
-
nextRow
读取下一行数据- Returns:
- CsvRow
- Throws:
org.miaixz.bus.core.lang.exception.InternalException- IO读取异常
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-