Top Description Methods
de.siegmar.fastcsv.writer

public Interface QuoteStrategy

Known Direct Implementers
de.siegmar.fastcsv.writer.QuoteStrategies

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
QuoteStrategies

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true, if an empty field should be quoted
quoteEmpty
(final int
the line number (1-based)
lineNo
,
final int
the field index (0-based)
fieldIdx
)

Determine if an empty (not null) field should be quoted.

public default boolean

Returns:

true, if a null field should be quoted
quoteNull
(final int
the line number (1-based)
lineNo
,
final int
the field index (0-based)
fieldIdx
)

Determine if a null field should be quoted.

public default boolean

Returns:

true, if a data containing field should be quoted
quoteValue
(final int
the line number (1-based)
lineNo
,
final int
the field index (0-based)
fieldIdx
,
final String
the field value; never null
value
)

Determine if a data containing field (neither null nor empty) should be quoted.

Method Detail

quoteEmptyback to summary
public default boolean quoteEmpty(final int lineNo, final int fieldIdx)

Determine if an empty (not null) field should be quoted.

Parameters
lineNo:int

the line number (1-based)

fieldIdx:int

the field index (0-based)

Returns:boolean

true, if an empty field should be quoted

quoteNullback to summary
public default boolean quoteNull(final int lineNo, final int fieldIdx)

Determine if a null field should be quoted.

Parameters
lineNo:int

the line number (1-based)

fieldIdx:int

the field index (0-based)

Returns:boolean

true, if a null field should be quoted

quoteValueback to summary
public default boolean quoteValue(final int lineNo, final int fieldIdx, final String value)

Determine if a data containing field (neither null nor empty) should be quoted.

Parameters
lineNo:int

the line number (1-based)

fieldIdx:int

the field index (0-based)

value:String

the field value; never null

Returns:boolean

true, if a data containing field should be quoted