Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Global Java Type Adapters in MOXy

Is it possible to define global java type adapters/converters in MOXy (up to the newest release (2.6.0)?
Such adapter would be applied by default to all classes registered in jaxb context if not explicitly overridden.

For instance, I would like to add support for all Joda Time types which would require neither a @XmlJavaTypeAdapter at a field nor a class nor a package level.

like image 543
Stepan Vavra Avatar asked Sep 29 '22 07:09

Stepan Vavra


1 Answers

Filed a bug for this.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=478404

Workaround I currently use: Create OXM bindings configuration dynamically at runtime and save it in memory as a String. Then feed it to MOXy via "eclipselink.oxm.metadata-source" property, using StringReaders.

like image 102
marcelv3612 Avatar answered Oct 07 '22 20:10

marcelv3612