title: Edit String field value when serializing object with Jackson
body: <p>In Spring MVC project, I have controllers which return data in the form of various objects. Later these objects are serialized to JSON, and JSON returned as a response to a client.</p>
  
  <p>This is achieved by registering custom <code>MappingJackson2HttpMessageConverter</code> with <code>configureMessageConverters()</code> in application config. The converter uses </p>
  
  <p><code>jackson.databind.ObjectWriter.writeValue(jackson.core.JsonGenerator, object)</code></p>
  
  <p>for object serialization.</p>
  
  <p>Now I need to implement XSS protection. Since all data goes through the step of serialization, I want to filter here String values, removing all symbols except those in whitelist (alphanumeric and some punctuation signs).</p>
  
  <p>Is there a way to provide Jackson with a filter which will edit String values during serialization?</p>