Search in sources :

Example 1 with Generator

use of org.apache.cxf.tools.plugin.Generator in project cxf by apache.

the class PluginLoader method getFrontEndGenerators.

private List<FrontEndGenerator> getFrontEndGenerators(FrontEnd frontend) {
    List<FrontEndGenerator> generators = new ArrayList<>();
    String fullClzName = null;
    try {
        for (Generator generator : frontend.getGenerators().getGenerator()) {
            fullClzName = getGeneratorClass(frontend, generator);
            Class<?> clz = ClassLoaderUtils.loadClass(fullClzName, this.getClass());
            generators.add((FrontEndGenerator) clz.newInstance());
        }
    } catch (Exception e) {
        Message msg = new Message("FRONTEND_PROFILE_LOAD_FAIL", LOG, fullClzName);
        LOG.log(Level.SEVERE, msg.toString());
        throw new ToolException(msg, e);
    }
    return generators;
}
Also used : Message(org.apache.cxf.common.i18n.Message) FrontEndGenerator(org.apache.cxf.tools.common.FrontEndGenerator) ArrayList(java.util.ArrayList) ToolException(org.apache.cxf.tools.common.ToolException) XMLStreamException(javax.xml.stream.XMLStreamException) IOException(java.io.IOException) JAXBException(javax.xml.bind.JAXBException) FileNotFoundException(java.io.FileNotFoundException) ToolException(org.apache.cxf.tools.common.ToolException) Generator(org.apache.cxf.tools.plugin.Generator) FrontEndGenerator(org.apache.cxf.tools.common.FrontEndGenerator)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 JAXBException (javax.xml.bind.JAXBException)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 Message (org.apache.cxf.common.i18n.Message)1 FrontEndGenerator (org.apache.cxf.tools.common.FrontEndGenerator)1 ToolException (org.apache.cxf.tools.common.ToolException)1 Generator (org.apache.cxf.tools.plugin.Generator)1