Interface FieldModifier

All Known Subinterfaces:
SimpleFieldModifier

public interface FieldModifier
Implementations of this class are used within CsvCallbackHandler implementations to modify the fields of a CSV record before storing them in the resulting object.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Chains multiple modifiers.
    default String
    modify(long startingLineNumber, int fieldIdx, boolean quoted, String field)
    Gets called for every single field (that is not a comment).
    default String
    modifyComment(long startingLineNumber, String field)
    Gets called for every comment.
  • Method Details

    • modify

      default String modify(long startingLineNumber, int fieldIdx, boolean quoted, String field)
      Gets called for every single field (that is not a comment). The Default implementation returns the field as is.
      Parameters:
      startingLineNumber - the starting line number (starting with 1)
      fieldIdx - the field index (starting with 0)
      quoted - true if the field was enclosed by the defined quote characters
      field - the field value, never null
      Returns:
      the modified field value (must not be null)
    • modifyComment

      default String modifyComment(long startingLineNumber, String field)
      Gets called for every comment. The Default implementation returns the field as is.
      Parameters:
      startingLineNumber - the starting line number (starting with 1)
      field - the field value (comment), never null
      Returns:
      the modified field value (must not be null)
    • andThen

      default FieldModifier andThen(FieldModifier after)
      Chains multiple modifiers.
      Parameters:
      after - the next modifier to use.
      Returns:
      a composed field modifier that first applies this modifier and then applies the after modifier