Search code examples
javajsonjaxbeclipselinkmoxy

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.


Solution

  • 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.