jaxb2-maven-plugin
jaxb2-maven-plugin copied to clipboard
Support Eclipselink MOXy as the JAXB XML and Schema generator in addition to the Reference implementation
MOXy has some nice additional features in addition to the Reference implementation, such as being able to generate and consume JSON (including JSON schema). Moreover, EclipseLink MOXy provides another entry point to schema generation than the reference implementation:
protected void generateSchema(Type[] typesToBeBound, MySchemaOutputResolver outputResolver, Map<QName, Type> additionalGlobalElements) {
JAXBContext jaxbContext;
try {
jaxbContext = (JAXBContext) JAXBContextFactory.createContext(typesToBeBound, null, loader);
jaxbContext.generateSchema(outputResolver, additionalGlobalElements);
} catch (JAXBException e) {
e.printStackTrace();
}
}
However, the Namespace prefix handling differ between the ReferenceImplementation and MOXy, implying this wrapping should be investigated more thoroughly.