1

I want to change the way XML date format is written, but I don't want to put annotations in every getter of the entire project.

Is there a way to set the XmlAdapter globally to all fields of a specific type? Or at least in each class and not in each method.

Obs: My models aren't generated, they are hand written.

Thanks!

Pedro Barros
  • 1,326
  • 1
  • 12
  • 19

1 Answers1

1

You can set the @XmlJavaTypeAdapter at the package level and have it apply to all mapped fields/properties in domain classes in that package. This is done on a special package-info class.

bdoughan
  • 147,609
  • 23
  • 300
  • 400