Say I have a namespace "B:" (for "Base"), with type <B:T1>. Say I also have a namespace "E:" (for ("Extended"), with type "<E:T2>" which extends <B:T1>.

In other complex types where a <B:T1> is expected, sometimes I'd like to instead insert an <E:T2>.

This was impossible to do with the class hierarchies of generated classes, using the default "element" javaclassmapping. With the "type" mapping, however, it's basically working now, but with one small hitch..

After I construct an instance of this hierarchy, when it's marshalled out to a DOM, the <E:T2> element is declared in E's namespace, like this:

<E:T2 xsi:type="E:T2"> ... </>

What I really want is for it to be serialized like this:

<B:T1 xsi:type="E:T2"> ... </>

I can achieve this effect by going into the generated *TypeDescriptor.java files, and sprinkling "desc.setNameSpaceURI(NS_B_URI);" here and there, but that's a little messy, I can't be sure if I got all the right places, and my changes will be lost if I regenerate the source files.

Is there a better, more centralized or automatic way I can set this behavior? Sorry if I'm missing the obvious..

Thank you,
Bryan

Reply via email to