Package org.jooq

Class CSVFormat


  • public final class CSVFormat
    extends java.lang.Object
    A CSV formatting type, which can be used to configure CSV imports / exports.
    Author:
    Lukas Eder
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CSVFormat.Quote
      When to apply the quote
    • Constructor Summary

      Constructors 
      Constructor Description
      CSVFormat()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String delimiter()
      The delimiter to be used between CSV cells, defaulting to ",".
      CSVFormat delimiter​(char newDelimiter)
      The delimiter to be used between CSV cells, defaulting to ",".
      CSVFormat delimiter​(java.lang.String newDelimiter)
      The delimiter to be used between CSV cells, defaulting to ",".
      java.lang.String emptyString()
      The string to be used for "" values, defaulting to the empty string.
      CSVFormat emptyString​(java.lang.String newEmptyString)
      The string to be used for "" values, defaulting to the empty string.
      boolean header()
      Whether to emit a header row with column names, defaulting to true.
      CSVFormat header​(boolean newHeader)
      Whether to emit a header row with column names, defaulting to true.
      java.lang.String newline()
      The string to be used to separate rows, defaulting to \n.
      CSVFormat newline​(java.lang.String newNewline)
      The string to be used to separate rows, defaulting to \n.
      java.lang.String nullString()
      The string to be used for null values, defaulting to the empty string.
      CSVFormat nullString​(java.lang.String newNullString)
      The string to be used for null values, defaulting to the empty string.
      CSVFormat.Quote quote()
      When to quote CSV content.
      CSVFormat quote​(CSVFormat.Quote newQuote)
      When to quote CSV content.
      java.lang.String quoteString()
      The string used to quote values according to the rules specified in quote().
      CSVFormat quoteString​(java.lang.String newQuoteString)
      The string used to quote values according to the rules specified in quote().
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CSVFormat

        public CSVFormat()
    • Method Detail

      • delimiter

        public CSVFormat delimiter​(java.lang.String newDelimiter)
        The delimiter to be used between CSV cells, defaulting to ",".

        Using "," a,b,c
        Using ";" a;b;c
      • delimiter

        public CSVFormat delimiter​(char newDelimiter)
        The delimiter to be used between CSV cells, defaulting to ",".

        Using "," a,b,c
        Using ";" a;b;c
      • delimiter

        public java.lang.String delimiter()
        The delimiter to be used between CSV cells, defaulting to ",".

        Using "," a,b,c
        Using ";" a;b;c
      • nullString

        public CSVFormat nullString​(java.lang.String newNullString)
        The string to be used for null values, defaulting to the empty string.

        Using "" a,,c
        Using "\"\"" a,"",c
        Using "{null}" a,{null},c
      • nullString

        public java.lang.String nullString()
        The string to be used for null values, defaulting to the empty string.

        Using "" a,,c
        Using "\"\"" a,"",c
        Using "{null}" a,{null},c
      • emptyString

        public CSVFormat emptyString​(java.lang.String newEmptyString)
        The string to be used for "" values, defaulting to the empty string.

        Using "" a,,c
        Using "\"\"" a,"",c
      • emptyString

        public java.lang.String emptyString()
        The string to be used for "" values, defaulting to the empty string.

        Using "" a,,c
        Using "\"\"" a,"",c
      • newline

        public CSVFormat newline​(java.lang.String newNewline)
        The string to be used to separate rows, defaulting to \n.
      • newline

        public java.lang.String newline()
        The string to be used to separate rows, defaulting to \n.
      • quoteString

        public CSVFormat quoteString​(java.lang.String newQuoteString)
        The string used to quote values according to the rules specified in quote().
      • quoteString

        public java.lang.String quoteString()
        The string used to quote values according to the rules specified in quote().
      • header

        public CSVFormat header​(boolean newHeader)
        Whether to emit a header row with column names, defaulting to true.
      • header

        public boolean header()
        Whether to emit a header row with column names, defaulting to true.