title: How to configure JAXB so it trims whitespaces by default
body: <p>I would like to configure JAXB so that it trims whitespaces on all string fields</p>
  
  <p>I saw the following answer : <a href="https://stackoverflow.com/questions/359315/how-to-configure-jaxb-so-it-trims-whitespaces-when-unmarshalling-tag-value">How to configure JAXB so it trims whitespaces when unmarshalling tag value?</a></p>
  
  <p>But I do not want to have to annotate all string fields as per the suggested answer</p>
  
  <pre><code>@XmlElement(required=true)
  @XmlJavaTypeAdapter(MyNormalizedStringAdapter.class)
  String name;
  </code></pre>
  
  <p>Thanks!</p>