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 [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to