-
- All Known Subinterfaces:
SimpleFieldModifier
public interface FieldModifier
Implementations of this class are used withinCsvCallbackHandler
implementations to modify the fields of a CSV record before storing them in the resulting object.- See Also:
FieldModifiers
,SimpleFieldModifier
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default FieldModifier
andThen(FieldModifier after)
Chains multiple modifiers.default java.lang.String
modify(long startingLineNumber, int fieldIdx, boolean quoted, java.lang.String field)
Gets called for every single field (that is not a comment).default java.lang.String
modifyComment(long startingLineNumber, java.lang.String field)
Gets called for every comment.
-
-
-
Method Detail
-
modify
default java.lang.String modify(long startingLineNumber, int fieldIdx, boolean quoted, java.lang.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 charactersfield
- the field value, nevernull
- Returns:
- the modified field value (must not be
null
)
-
modifyComment
default java.lang.String modifyComment(long startingLineNumber, java.lang.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), nevernull
- 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
-
-