Interface QuoteMode

All Known Implementing Classes:
AlwaysQuoteMode, ColumnQuoteMode, NormalQuoteMode

public interface QuoteMode
The interface for quoting modes. The quote mode allows quoting to be enabled in cases where quotes would not normally be required (because the column doesn't contain any special characters). It is not a way to disable quoting altogether - to do that you must supply your own CsvEncoder.
Since:
2.1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    quotesRequired(String csvColumn, CsvContext context, CsvPreference preference)
    Determines whether surrounding quotes are mandatory in cases where the CSV column would not normally be quoted (the data to be written doesn't contain special characters).
  • Method Details

    • quotesRequired

      boolean quotesRequired(String csvColumn, CsvContext context, CsvPreference preference)
      Determines whether surrounding quotes are mandatory in cases where the CSV column would not normally be quoted (the data to be written doesn't contain special characters).
      Parameters:
      csvColumn - an element of a CSV file
      context - the context
      preference - the CSV preferences
      Returns:
      true if surrounding quotes are mandatory, otherwise false