Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for unmarshalling of non-@XmlRoot types [SWS-580] #699

Closed
gregturn opened this issue Oct 28, 2009 · 4 comments
Closed

Allow for unmarshalling of non-@XmlRoot types [SWS-580] #699

gregturn opened this issue Oct 28, 2009 · 4 comments

Comments

@gregturn
Copy link
Contributor

David J. M. Karlsen opened SWS-580 and commented

When unmarshalling non-@XmlRoot element types there is a need to specify the expected type,
and I have to use a workaround to work with the native jaxb2 unmarshaller, like this:

JAXBElement<S2SDDDirectDebitTransactionInformation2> element = ebaUnmarshaller.getJaxbContext().createUnmarshaller().unmarshal( source, S2SDDDirectDebitTransactionInformation2.class );

It would be handy to expose a method to give the expected return type - and this should be a generic/parameterized method.
See: http://www.docjar.com/docs/api/javax/xml/bind/Unmarshaller.html "Unmarshal a root element that is globally declared" and the following section for an thorough explaination.


Affects: 1.5.8

1 votes, 3 watchers

@gregturn
Copy link
Contributor Author

Stevo Slavić commented

Problem is that not all OXM frameworks support this functionality.

David, how did you access JAXBContext when that getter is protected in Jaxb2Marshaller?

Maybe just exposing that getter as public would suffice.

@gregturn
Copy link
Contributor Author

Stevo Slavić commented

This issue should be moved to Spring Framework JIRA, since OXM module is now part of Spring Framework itself.

@gregturn
Copy link
Contributor Author

David J. M. Karlsen commented

It's not a protected method, nor is it specific to any framework.
It's declared in the API interface:
http://docs.oracle.com/javaee/5/api/javax/xml/bind/Unmarshaller.html
It's now resolved in the framework: https://jira.springsource.org/browse/SPR-10282 to be released in 3.2.2.

@gregturn
Copy link
Contributor Author

Stevo Slavić commented

David, in your example from this issue description, you use getJaxbContext() method of Spring's Jaxb2Marshaller which is protected.
(see here).

Thanks for reference to SPR-10282. Then this one can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants