JAXB: Generating "group" and "attributeGroup" as interface declarations

I am trying to achieve some improved source of Java generation from XSD using JAXB / XJC. I want to do the following: “group” and “attributeGroup” declarations in the context of Java can be considered as “interface” declarations: they prescribe a specific set of functions supported by a type that refers to a “group” or “attribute group”. Now I’m looking for a way to automatically generate an interface declaration for each "group" / "attributeGroup" and at the same time generate interface implementation declarations for the corresponding generated classes. Is there a plugin or setting in XJC for this? Is there any other solution for this scenario that you know about?

+6
source share
1 answer

Well, now, to answer my own question, I created my own jaxb / xjc plugin to complete this task. It is hosted on GitHub:

https://github.com/mklemm/jaxb2-rich-contract-plugin

+5
source

Source: https://habr.com/ru/post/958783/


All Articles