I have successfully managed to sub-class the JAXB classes and interfaces to add my own behaviour. I know this is not a particularly elegant design, as my domain classes are then bound to XML. Delegation/composition would be much better, but this is a lot more work.
So here is my problem: I was hoping to just change the ObjectFactory class to do this, but unfortuately I also had to change the JAXB parent class (i.e. the parent class by composition) to instantiate my new class. This really should not be necessary as the ObjectFactory class already provides mappings for all XML elements. In other words I was only hoping the change the ObjectFactory class each time I needed to re-generate the JAXB classes.
Is this going to be changed for the final release of JAXB? It would be so useful if it was and in my opinion is such a fundamental requirement.
I look forward to a response.
Thanks.
Dean.