There is no such callback.

What is usually done, I think, is to first serialize content as a tree
(JsonNode), traverse that, make necessary modifications,
and then serialize tree value.

-+ Tatu +-

On Tue, Feb 19, 2019 at 1:47 PM <curtwilli...@gmail.com> wrote:

> I am using jackson-dataformat-csv to export a POJO collection to CSV as
> follows:
>
>
> CsvSchema.Builder schemaBuilder = CsvSchema.builder()
>   .addColumn("id")
>   .addColumn("name")
>   etc...CsvSchema schema = schemaBuilder.build().withHeader();CsvMapper 
> mapper = new CsvMapper();
> mapper.enable(CsvGenerator.Feature.ALWAYS_QUOTE_STRINGS);String csv = 
> mapper.writer(schema).writeValueAsString(pojoCollection);
>
>
> I want to inspect every field value before it is written to CSV and
> optionally modify that value to prevent formulas or other content that
> Excel, Sheets, etc might execute. For example if a value starts with @ or
> = then I might prepend the ' character to that value to prevent execution.
>
>
> How can I configure CsvMapper so that I get a callback for each value
> written to CSV?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jackson-user+unsubscr...@googlegroups.com.
> To post to this group, send email to jackson-user@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jackson-user+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to