Interface QuoteStrategy


public interface QuoteStrategy
A quote strategy is used to decide whether to quote fields if quoting is optional (as per RFC 4180).

If a field contains characters for which the RFC dictates quoting, this QuoteStrategy won't be called for a decision.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    quoteEmpty(int lineNo, int fieldIdx)
    Determine if an empty (not null) field should be quoted.
    default boolean
    quoteNonEmpty(int lineNo, int fieldIdx, String value)
    Determine if a data containing field should be quoted.
    default boolean
    quoteNull(int lineNo, int fieldIdx)
    Determine if a null field should be quoted.
  • Method Details

    • quoteNull

      default boolean quoteNull(int lineNo, int fieldIdx)
      Determine if a null field should be quoted.
      Parameters:
      lineNo - the line number (1-based)
      fieldIdx - the field index (0-based)
      Returns:
      true, if a null field should be quoted
    • quoteEmpty

      default boolean quoteEmpty(int lineNo, int fieldIdx)
      Determine if an empty (not null) field should be quoted.
      Parameters:
      lineNo - the line number (1-based)
      fieldIdx - the field index (0-based)
      Returns:
      true, if an empty field should be quoted
    • quoteNonEmpty

      default boolean quoteNonEmpty(int lineNo, int fieldIdx, String value)
      Determine if a data containing field should be quoted.
      Parameters:
      lineNo - the line number (1-based)
      fieldIdx - the field index (0-based)
      value - the field value
      Returns:
      true, if a data containing field should be quoted