1

I want my xjc generated root class extend one of my class A, which is nothing but a wrapper around the root class. Can i do that without modifying the xsd file (how to force schema compiled classes to extend specific class outside schema)

Community
  • 1
  • 1
S Kr
  • 1,831
  • 2
  • 25
  • 50

1 Answers1

1

You can define a super-root class (see http://jaxb.java.net/nonav/2.0.2/docs/vendorCustomizations.html). Every generated class (in that xjc run) will be extending that root class.
The required global binding can be declared in an external binding file instead of inside the xsd (see http://java.sun.com/webservices/docs/1.4/tutorial/doc/JAXBUsing4.html#wp148515). Then you can pass it to the xjc generator together with the xsd.

Pyranja
  • 3,529
  • 22
  • 24