|MOXy Schema generation of xsd:restictions [message #1707431]
||Fri, 04 September 2015 16:44
| J F
Registered: July 2009
MOXy BeanValidator gives me the ability to add validation to my JAXB classes.|
Using Moxy's XJC "Bean Validation Plugin" I can generate Bean Validation in my generated JAXB classes based on Schema restrictions or facets.
However is there any way of generating a schema with restrictions based on a java class annotated with Bean Validation annotations?
XJC has a handy plugin architecture, but so far as I can see there is no 'Java first' equivalent which I can plugin into if I wish to enhance the generated XSD with additional restrictions or facets, or even to add XML comments. Where would I start if I wanted to add this functionality to MOXy? MOXy is extremely flexible with meet in the middle mappings, can this be used during schema generation?
The jaxb-facets code seems to do what I want but evidently this is aimed at the JAXB-RI and work in this area at least seems stalled according to this java.net JIRA. So in terms of tracking a spec I guess the simplest thing would be to support Java Bean Validation Annotations -> XSD facets as a mirror image of what Moxy already does XSD facets -> Java Bean Validation Annotations. Would the Eclipselink team be open to taking in an implementation of this for MOXy?
[Updated on: Mon, 07 September 2015 16:59]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02854 seconds