Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

jaxb

xsd

xjc

I'm trying to achieve some advanced Java source generation from XSD with JAXB/XJC. What I want do to is the following: "group" and "attributeGroup" declarations, in a Java context, can be seen as "interface" declarations: They prescribe a specific set of features supported by a type referencing the "group" or "attributeGroup". I am now looking for a way to automatically generate an interface declaration for each "group"/"attributeGroup" and at the same time generate interface implementation declarations on the respective generated classes. Is there a plug-in or setting in XJC to achieve this? Is there any other solution to this scenario you know of?

like image 824
Mirko Klemm Avatar asked Nov 25 '13 16:11

Mirko Klemm


1 Answers

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

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

like image 142
Mirko Klemm Avatar answered Oct 27 '22 11:10

Mirko Klemm