Class FixedWidthReaderSettings

java.lang.Object
io.leandev.appfuse.csv.FixedWidthReaderSettings

public class FixedWidthReaderSettings extends Object

固定寬度文本讀取器設定

用於配置固定寬度格式檔案的讀取行為。

使用範例

FixedWidthReaderSettings settings = new FixedWidthReaderSettings();
settings.setFieldLengths(new int[]{10, 20, 15, 10});
settings.setSkipEmptyLines(true);
settings.setTrimValues(true);
Since:
1.0
  • Constructor Details

    • FixedWidthReaderSettings

      public FixedWidthReaderSettings()
      預設建構子
    • FixedWidthReaderSettings

      public FixedWidthReaderSettings(FixedWidthReaderSettings other)
      複製建構子
      Parameters:
      other - 要複製的設定
  • Method Details

    • validate

      public void validate()
      驗證設定是否有效
      Throws:
      IllegalStateException - 若設定無效
    • getTotalWidth

      public int getTotalWidth()
      取得總寬度
      Returns:
      所有欄位寬度的總和