Subclassing a Generated Class
The classes that the JAXB generates are not final, so you are free to extend them to add any application-specific behavior. Follow the standard rules for subclassing any of the generated classes. For example, consider a SaleableBook class that adds in a markup to the price of a Book before reporting it to the user.
Get Java™ Web Services Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.