[SWS-627] Get rid of the JAXBElement when using Jaxb2Marshaller Created: 05/Jul/10  Updated: 05/Jul/10

Status: Open
Project: Spring Web Services
Component/s: OXM
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Pierre Lecesne Assignee: Arjen Poutsma
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When using JAXB2, depending on the number of elements defined in the the XML schema, the unmarshalled objects can be either of type MyClass (exactly one element in the XML schema) or JAXBElement<MyClass> (more than one element) – see http://weblogs.java.net/blog/2006/03/03/why-does-jaxb-put-xmlrootelement-sometimes-not-always

This would be very useful if the class org.springframework.oxm.jaxb.Jaxb2Marshaller of the Spring Framework could do the abstraction of the JAXBElement for us, ie. :

  • always returning an object of type MyClass when unmarshalling (by calling the getValue() method on the JAXBElement for us).
  • allowing passing an object of type MyClass when marshalling even though a JAXBElement<MyClass> would normally be expected.

Then our code wouldn't have any code dependency upon the chosen marshaller (JAXB in this case).


Generated at Mon Dec 11 13:02:04 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.