jaxb2-maven-plugin icon indicating copy to clipboard operation
jaxb2-maven-plugin copied to clipboard

Support Eclipselink MOXy as the JAXB XML and Schema generator in addition to the Reference implementation

Open lennartj opened this issue 8 years ago • 0 comments

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.

lennartj avatar Sep 12 '16 14:09 lennartj