Class AlwaysQuoteMode

  • All Implemented Interfaces:
    QuoteMode

    public class AlwaysQuoteMode
    extends java.lang.Object
    implements QuoteMode
    When using AlwaysQuoteMode surrounding quotes are always applied.
    Since:
    2.1.0
    Author:
    James Bassett
    • Constructor Summary

      Constructors 
      Constructor Description
      AlwaysQuoteMode()
      Constructs a new AlwaysQuoteMode.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean quotesRequired​(java.lang.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).
      • Methods inherited from class java.lang.Object

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

      • AlwaysQuoteMode

        public AlwaysQuoteMode()
        Constructs a new AlwaysQuoteMode.
    • Method Detail

      • quotesRequired

        public boolean quotesRequired​(java.lang.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).
        Specified by:
        quotesRequired in interface QuoteMode
        Parameters:
        csvColumn - an element of a CSV file
        context - the context
        preference - the CSV preferences
        Returns:
        true if surrounding quotes are mandatory, otherwise false