Hi list, it looks like this comes up from time to time but I haven't seen a
good answer:
I'm using NetBeans 6.1 and the JAXB stuff that comes with it to generate some
classes, which are then used to generate some XML.
I have 2 schemas, one of which is mostly a subset of the other. Is there a best
practice for demultiplexing object access, when I'm only going to use the
common parts? I'd prefer not to modify either of the schemas if possible since
they are somewhat large.
For instance, Schema A and Schema B both refer to a "Length" object; is there a
nice way to refer generically to the Length object for either schema (and do it
dynamically)? Obviously this gets complicated because I have to use the
correct ObjectFactory and the generated classes are seperated by namespace.
Is there any duck-typing I can do? Maybe some AOP hack? Or a generic class with
a large number of unbound type variables?
Thanks!
Dave