问题
I'm trying to automatically implement an interface in one java class generated from a xsd file.
This looks as if it could do that, but it will only add implements SomeInterface
to all classes, which is completly stupid. Am I missing something or can you only do this for all classes? Doesn't really make too much sence to let all generated classes implement the same interface. Can I use this feature for one class only?
回答1:
You could use Inheritance extension provided by JAXB2 Basics Plugins. This works for particular classes (i.e. xsd:complexType
s)
This is also described in answers of this question: Generating a JAXB class that implements an interface
来源:https://stackoverflow.com/questions/9926402/xjc-superinterface-and-superclass-only-for-all-classes