Class CsvReadConfig

java.lang.Object
org.aoju.bus.office.csv.CsvConfig<CsvReadConfig>
org.aoju.bus.office.csv.CsvReadConfig
All Implemented Interfaces:
Serializable

public class CsvReadConfig extends CsvConfig<CsvReadConfig> implements Serializable
CSV读取配置项
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Field Details

    • skipEmptyRows

      protected boolean skipEmptyRows
      是否跳过空白行,默认true
    • errorOnDifferentFieldCount

      protected boolean errorOnDifferentFieldCount
      每行字段个数不同时是否抛出异常,默认false
    • beginLineNo

      protected long beginLineNo
      定义开始的行(包括),此处为原始文件行号
    • endLineNo

      protected long endLineNo
      结束的行(包括),此处为原始文件行号
    • trimField

      protected boolean trimField
      每个字段是否去除两边空白符
    • headerLineNo

      protected long headerLineNo
      指定标题行号,-1表示无标题行
  • Constructor Details

    • CsvReadConfig

      public CsvReadConfig()
  • Method Details

    • defaultConfig

      public static CsvReadConfig defaultConfig()
      默认配置
      Returns:
      默认配置
    • setContainsHeader

      public CsvReadConfig setContainsHeader(boolean containsHeader)
      设置是否首行做为标题行,默认false 当设置为true时,默认标题行号是beginLineNofalse为-1,表示无行号
      Parameters:
      containsHeader - 是否首行做为标题行,默认false
      Returns:
      this
      See Also:
    • setHeaderLineNo

      public CsvReadConfig setHeaderLineNo(long headerLineNo)
      设置标题行行号,默认-1,表示无标题行
      Parameters:
      headerLineNo - 标题行行号,-1表示无标题行
      Returns:
      this
    • setSkipEmptyRows

      public CsvReadConfig setSkipEmptyRows(boolean skipEmptyRows)
      设置是否跳过空白行,默认true
      Parameters:
      skipEmptyRows - 是否跳过空白行,默认true
      Returns:
      this
    • setErrorOnDifferentFieldCount

      public CsvReadConfig setErrorOnDifferentFieldCount(boolean errorOnDifferentFieldCount)
      设置每行字段个数不同时是否抛出异常,默认false
      Parameters:
      errorOnDifferentFieldCount - 每行字段个数不同时是否抛出异常,默认false
      Returns:
      this
    • setBeginLineNo

      public CsvReadConfig setBeginLineNo(long beginLineNo)
      设置开始的行(包括),默认0,此处为原始文件行号
      Parameters:
      beginLineNo - 开始的行号(包括)
      Returns:
      this
    • setEndLineNo

      public CsvReadConfig setEndLineNo(long endLineNo)
      设置结束的行(包括),默认不限制,此处为原始文件行号
      Parameters:
      endLineNo - 结束的行号(包括)
      Returns:
      this
    • setTrimField

      public CsvReadConfig setTrimField(boolean trimField)
      设置每个字段是否去除两边空白符 如果字段以CsvConfig.textDelimiter包围,则保留两边空格
      Parameters:
      trimField - 去除两边空白符
      Returns:
      this