Interface QuoteStrategy
- All Known Implementing Classes:
QuoteStrategies
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 TypeMethodDescriptiondefault booleanquoteEmpty(int lineNo, int fieldIdx) Determine if an empty (notnull) field should be quoted.default booleanquoteNull(int lineNo, int fieldIdx) Determine if anullfield should be quoted.default booleanquoteValue(int lineNo, int fieldIdx, String value) Determine if a data containing field (neithernullnor empty) should be quoted.
-
Method Details
-
quoteNull
default boolean quoteNull(int lineNo, int fieldIdx) Determine if anullfield should be quoted.- Parameters:
lineNo- the line number (1-based)fieldIdx- the field index (0-based)- Returns:
true, if anullfield should be quoted
-
quoteEmpty
default boolean quoteEmpty(int lineNo, int fieldIdx) Determine if an empty (notnull) 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
-
quoteValue
Determine if a data containing field (neithernullnor empty) should be quoted.- Parameters:
lineNo- the line number (1-based)fieldIdx- the field index (0-based)value- the field value; nevernull- Returns:
true, if a data containing field should be quoted
-