Friday, 6 February 2015

How to marshall object casted to his superclass in JAXB



I have generated class BookingStructure that marshalling into



<BookingStructure>
<elementBookingStructure />
</BookingStructure>


and inherited from him class Booking that marshalling into



<Booking>
<elementBookignStructure />
<elementBooking />
</Booking>


I need to marshall Booking like BookingStructure



<BookingStructure>
<elementBookingStructure />
</BookingStructure>


How can I do this using javax.xml.bind? Thanks


No comments:

Post a Comment