Search in sources :

Example 1 with Mapping

use of com.sun.tools.xjc.api.Mapping in project Activiti by Activiti.

the class CxfWSDLImporter method importTypes.

protected void importTypes(Types types) {
    SchemaCompiler compiler = XJC.createSchemaCompiler();
    ErrorListener elForRun = new ConsoleErrorReporter();
    compiler.setErrorListener(elForRun);
    SchemaImpl impl = (SchemaImpl) types.getExtensibilityElements().get(0);
    S2JJAXBModel intermediateModel = this.compileModel(types, compiler, impl.getElement());
    Collection<? extends Mapping> mappings = intermediateModel.getMappings();
    for (Mapping mapping : mappings) {
        this.importStructure(mapping);
    }
}
Also used : ErrorListener(com.sun.tools.xjc.api.ErrorListener) SchemaImpl(com.ibm.wsdl.extensions.schema.SchemaImpl) ConsoleErrorReporter(com.sun.tools.xjc.ConsoleErrorReporter) S2JJAXBModel(com.sun.tools.xjc.api.S2JJAXBModel) Mapping(com.sun.tools.xjc.api.Mapping) SchemaCompiler(com.sun.tools.xjc.api.SchemaCompiler)

Example 2 with Mapping

use of com.sun.tools.xjc.api.Mapping in project Activiti by Activiti.

the class WSDLImporter method importTypes.

/**
   * Import the Types from the WSDL definition using the same strategy that
   * Cxf uses taking advantage of JAXB
   */
private void importTypes(Types types) {
    SchemaCompiler compiler = XJC.createSchemaCompiler();
    ErrorListener elForRun = new ConsoleErrorReporter();
    compiler.setErrorListener(elForRun);
    Element rootTypes = this.getRootTypes();
    this.createDefaultStructures(rootTypes);
    S2JJAXBModel intermediateModel = this.compileModel(types, compiler, rootTypes);
    Collection<? extends Mapping> mappings = intermediateModel.getMappings();
    for (Mapping mapping : mappings) {
        this.importStructure(mapping);
    }
}
Also used : ErrorListener(com.sun.tools.xjc.api.ErrorListener) ConsoleErrorReporter(com.sun.tools.xjc.ConsoleErrorReporter) Element(org.w3c.dom.Element) S2JJAXBModel(com.sun.tools.xjc.api.S2JJAXBModel) Mapping(com.sun.tools.xjc.api.Mapping) SchemaCompiler(com.sun.tools.xjc.api.SchemaCompiler)

Aggregations

ConsoleErrorReporter (com.sun.tools.xjc.ConsoleErrorReporter)2 ErrorListener (com.sun.tools.xjc.api.ErrorListener)2 Mapping (com.sun.tools.xjc.api.Mapping)2 S2JJAXBModel (com.sun.tools.xjc.api.S2JJAXBModel)2 SchemaCompiler (com.sun.tools.xjc.api.SchemaCompiler)2 SchemaImpl (com.ibm.wsdl.extensions.schema.SchemaImpl)1 Element (org.w3c.dom.Element)1