|Using XmlJavaTypeAdapter(s) to map a third party class [message #1793712]
||Tue, 14 August 2018 12:51
| Sebastian Frehmel
Registered: August 2018
We have a third party library which consists entirely of POJOs and interfaces. We cannot modify the source code. Those POJOs can be deeply nested within themselves and cross-referencing each other.|
We are trying to generate XML from a class structure that starts in our own code and then uses that third party lib's classes. We wish to generate XML all the way down to the leaves of the structural chain.
Some POJOs can be used as-is, but some - and the interfaces - will require using XmlJavaTypeAdapter(s) to transform them into XML.
So far we have been looking at JAXB that comes with Java 8. It is possible to create the package of one of those POJOs in our project and add the @XmlJavaTypeAdapters annotation to the package-info.java in there. This works locally in tests. However, due to a highly complex general setup of different class loaders, Maven etc, we can't use this approach in production.
So I came to MOXy.
My direct question is:
Can I use the externalized XML bindings file (specified through http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_4.xsd) to add XmlJavaTypeAdapter(s) without using annotations in the Java code? In a way that it works for third party classes?
Powered by FUDForum
. Page generated in 0.01867 seconds