public interface CsvValueDecorator
Decorations are handled after handling other encoding aspects such as optional quoting and/or escaping.
Decorators can be registered on specific columns of CsvSchema.
| Modifier and Type | Method and Description |
|---|---|
default String |
decorateNull(CsvGenerator gen)
Method called instead of
decorateValue(com.fasterxml.jackson.dataformat.csv.CsvGenerator, java.lang.String) in case where value being
written is from Java null value: this is often left as-is, without
decoration (and this is the default implementation), but may be
decorated. |
String |
decorateValue(CsvGenerator gen,
String plainValue)
Method called during serialization when encoding a value,
to produce "decorated" value to include in output (possibly
escaped and/or quoted).
|
String |
undecorateValue(CsvParser parser,
String decoratedValue)
Method called during deserialization, to remove possible decoration
applied with
decorateValue(com.fasterxml.jackson.dataformat.csv.CsvGenerator, java.lang.String). |
String decorateValue(CsvGenerator gen, String plainValue) throws IOException
CsvSchema is applied on decorated value.gen - Generator that will be used for actual serializationplainValue - Value to decorateplainValue as-is) but
Must Not be nullIOException - if attempt to decorate the value somehow fails
(typically a StreamWriteException)default String decorateNull(CsvGenerator gen) throws IOException
decorateValue(com.fasterxml.jackson.dataformat.csv.CsvGenerator, java.lang.String) in case where value being
written is from Java null value: this is often left as-is, without
decoration (and this is the default implementation), but may be
decorated.
To let default Null Value Replacement be used, should return null:
this is the default implementation.gen - Generator that will be used for actual serializationnull: if null will use
default null replacement value.IOException - if attempt to decorate the value somehow fails
(typically a StreamWriteException)String undecorateValue(CsvParser parser, String decoratedValue) throws IOException
decorateValue(com.fasterxml.jackson.dataformat.csv.CsvGenerator, java.lang.String).
Call is made after textual value for a cell (column
value) has been read using parser and after removing (decoding)
possible quoting and/or escaping of the value. Value passed in
has no escaping or quoting left.parser - Parser that was used to decode textual value from inputdecoratedValue - Value from which to remove decorations, if any
(some decorators can allow optional decorations; others may fail
if none found)IOException - if attempt to un-decorate the value fails
(typically a StreamReadException)Copyright © 2025 FasterXML. All rights reserved.