Inheritance in XML Schema definition (XSD) for Java objects
- by bguiz
Hi,
I need to create an XML schema definition (XSD) that describes Java objects.
I was wondering how to do this when the objects in question inherit from a common base class with a type parameter.
public abstract class Rule<T> { ... }
public abstract class TimeRule extends Rule<XTime> { ... }
public abstract class LocationRule extends Rule<Location> { ... }
public abstract class IntRule extends Rule<Integer> { ... }
....
(where XTime and Location are custom classes define elsewhere)
How would I go about constructing an XSD that such that I can have XML nodes that represent each of the subclasses of Rule<T> - without the XSD for each of them repeating their common contents?
Thank you!