Use moxy to handle 3rd party interfaces [message #1766919] |
Wed, 28 June 2017 17:51 |
Hector Fontanez Messages: 1 Registered: June 2017 |
Junior Member |
|
|
I am trying to figure out a way to Marshal a 3rd party object into XML using moxy.
At a high level, what I am trying to do is to save off the internal properties of a chart object (axis information, chart color, title value, etc), by simply passing a non-annotated object to the JAXB marshaler.. like this:
JAXBContext context = JAXBContext.newInstance(ThirdPartyChartClass.class);
JAXBElement<ThirdPartyChartClass> je2 = new JAXBElement<ThirdPartyChartClass>(new QName(thirdPartyChartObject.getUniqueId()), ThirdPartyChartClass.class, thirdPartyChartObject);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(je2, System.out);
The problem that I am running into is that the 3rd party object have interfaces in it. Without obtaining the 3rd party source and map these internal members manually (which can be a HUGE undertaking) I do not know how to resolve this issue.
|
|
|
Powered by
FUDForum. Page generated in 0.02133 seconds