You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I want to unmarshal an XML document on to a class that doesn't have the
@XmlRootElement annotation, then I can use unmarshaller.unmarshal(source, Class)
to tell it which type to bind to, and it'll return me a JAXBElement for that type.
However, if I want to use JAXBResult to pipe a transform on to the same type, I
have no such option. JAXBResult gets a UnmarshallerHandler from the
Unmarshaller, but there's no mechanism for passing in the target type. And so,
JAXBResult can only target @XmlRootElement-annotated clases, which severely
limits its usefulness.
WOuld it be possible to have JAXBResult modified so that I can construct it with
a JAXBContext, plus a target type?
JAXBResult result = new JAXBResult(context, MyClass.class);
// perform transform on to result
JAXBElement output = result.getResult();
Environment
Operating System: All
Platform: All
Affected Versions
[2.1.12]
The text was updated successfully, but these errors were encountered:
If I want to unmarshal an XML document on to a class that doesn't have the
@XmlRootElement annotation, then I can use unmarshaller.unmarshal(source, Class)
to tell it which type to bind to, and it'll return me a JAXBElement for that type.
However, if I want to use JAXBResult to pipe a transform on to the same type, I
have no such option. JAXBResult gets a UnmarshallerHandler from the
Unmarshaller, but there's no mechanism for passing in the target type. And so,
JAXBResult can only target @XmlRootElement-annotated clases, which severely
limits its usefulness.
WOuld it be possible to have JAXBResult modified so that I can construct it with
a JAXBContext, plus a target type?
JAXBResult result = new JAXBResult(context, MyClass.class);
// perform transform on to result
JAXBElement output = result.getResult();
Environment
Operating System: All
Platform: All
Affected Versions
[2.1.12]
The text was updated successfully, but these errors were encountered: