mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
106 stars 77 forks source link

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

Open lennartj opened 8 years ago

lennartj commented 8 years ago

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.