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
    Constructs a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
     
    setCharacterOffset(long characterOffset)
    Sets the lexer offset when the parser does not start parsing at the beginning of the source.
    Sets the CSV format.
    setRecordNumber(long recordNumber)
    Sets the next record number to assign, defaults to 1.
    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

      Sets the CSV format. A copy of the given format is kept.
      Parameters:
      format - the CSV format, null is equivalent 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