CSVParser.Builder (Apache Commons CSV 1.14.1 API)
Description: declaration: package: org.apache.commons.csv, class: CSVParser, class: Builder

Package org.apache.commons.csv

# Class CSVParser.Builder

java.lang.Object
org.apache.commons.io.build.AbstractSupplier<CSVParser,CSVParser.Builder>
org.apache.commons.io.build.AbstractOriginSupplier<CSVParser,CSVParser.Builder>
org.apache.commons.io.build.AbstractStreamBuilder<CSVParser,CSVParser.Builder>
org.apache.commons.csv.CSVParser.Builder

All Implemented Interfaces:
  `org.apache.commons.io.function.IOSupplier<CSVParser>`

Enclosing class:
  `CSVParser`

public static class CSVParser.Builder extends org.apache.commons.io.build.AbstractStreamBuilder<CSVParser,CSVParser.Builder>
Builds a new `CSVParser`.

Since:
  1.13.0

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Builder()`
  Constructs a new instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CSVParser`
  `get()`
  `CSVParser.Builder`
  `setCharacterOffset(long characterOffset)`
  Sets the lexer offset when the parser does not start parsing at the beginning of the source.
  `CSVParser.Builder`
  `setFormat(CSVFormat format)`
  Sets the CSV format.
  `CSVParser.Builder`
  `setRecordNumber(long recordNumber)`
  Sets the next record number to assign, defaults to `1`.
  `CSVParser.Builder`
  `setTrackBytes(boolean trackBytes)`
  Sets whether to enable byte tracking for the parser.

  ### Methods inherited from class org.apache.commons.io.build.AbstractStreamBuilder

  `getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptions`

  ### Methods inherited from class org.apache.commons.io.build.AbstractOriginSupplier

  `checkOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriter`

  ### Methods inherited from class org.apache.commons.io.build.AbstractSupplier

  `asThis`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.commons.io.function.IOSupplier

  `asSupplier, getUnchecked`

- ## Constructor Details

  - ### Builder

    protected Builder()
    Constructs a new instance.

- ## Method Details

  - ### get

    public CSVParser get() throws IOException
    Throws:
      `IOException`

  - ### setCharacterOffset

    public CSVParser.Builder setCharacterOffset(long characterOffset)
    Sets the lexer offset when the parser does not start parsing at the beginning of the source.
    Parameters:
      `characterOffset` - the lexer offset.
    Returns:
      this instance.

  - ### setFormat

    public CSVParser.Builder setFormat(CSVFormat format)
    Sets the CSV format. A copy of the given format is kept.
    Parameters:
      `format` - the CSV format, `null` resets to `CSVFormat.DEFAULT`.
    Returns:
      this instance.

  - ### setRecordNumber

    public CSVParser.Builder setRecordNumber(long recordNumber)
    Sets the next record number to assign, defaults to `1`.
    Parameters:
      `recordNumber` - the next record number to assign.
    Returns:
      this instance.

  - ### setTrackBytes

    public CSVParser.Builder setTrackBytes(boolean trackBytes)
    Sets whether to enable byte tracking for the parser.
    Parameters:
      `trackBytes` - `true` to enable byte tracking; `false` to disable it.
    Returns:
      this instance.
    Since:
      1.13.0