Reputation: 11691
This question is related to JAXB2 type restriction not working?. I want to extend XJC to support type restrictions. It would be as simple as overriding super class' field definitions.
Is there any way to do that properly? Any hooks? Any similar tools?
Upvotes: 3
Views: 318
Reputation: 43651
Yes, XJC is extensible with plugins:
What can a plugin do?
A JAXB RI plugin participates in the code generation from a schema. It can define its own customizations that users can use to control it, it can access the code that the JAXB RI generates, and it can generate additional classes/methods/fields/annotations/comments.
A plugin can also choose to take over the XJC's code generation process completely. Only one plugin can do this at any given time, but this allows a plugin to generate radically different code from a schema.
Also see this answer:
What is the role of ClassOutline / JClass / CClass in CodeModel?
But no, I don't think this is the right way to address the problem that you have.
Try to figure out the bindings or patch the schema.
Upvotes: 2