com.sun.tools.xjc.api.XJC Java Examples

The following examples show how to use com.sun.tools.xjc.api.XJC. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WSDLImporter.java    From activiti6-boot2 with Apache License 2.0 6 votes vote down vote up
/**
 * Import the Types from the WSDL definition using the same strategy that Cxf uses taking advantage of JAXB
 */
protected 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);
  }
}
 
Example #2
Source File: WSDLImporter.java    From flowable-engine with Apache License 2.0 6 votes vote down vote up
/**
 * Import the Types from the WSDL definition using the same strategy that Cxf uses taking advantage of JAXB
 */
protected 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);
    }
}
 
Example #3
Source File: CxfWSDLImporter.java    From activiti6-boot2 with Apache License 2.0 5 votes vote down vote up
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);
  }
}
 
Example #4
Source File: FromXmlConfig.java    From kafka-connect-transform-xml with Apache License 2.0 5 votes vote down vote up
public static ConfigDef config() {
  SchemaCompiler schemaCompiler = XJC.createSchemaCompiler();
  Options options = schemaCompiler.getOptions();

  return new ConfigDef()
      .define(
          ConfigKeyBuilder.of(SCHEMA_PATH_CONFIG, ConfigDef.Type.LIST)
              .documentation(SCHEMA_PATH_DOC)
              .importance(ConfigDef.Importance.HIGH)
              .validator(new ValidUrl())
              .build()
      ).define(
          ConfigKeyBuilder.of(PACKAGE_CONFIG, ConfigDef.Type.STRING)
              .documentation(PACKAGE_DOC)
              .importance(ConfigDef.Importance.HIGH)
              .defaultValue(FromXmlConfig.class.getPackage().getName() + ".model")
              .build()
      ).define(
          ConfigKeyBuilder.of(XJC_OPTIONS_STRICT_CHECK_CONFIG, ConfigDef.Type.BOOLEAN)
              .documentation(XJC_OPTIONS_STRICT_CHECK_DOC)
              .importance(ConfigDef.Importance.LOW)
              .defaultValue(options.strictCheck)
              .build()
      ).define(
          ConfigKeyBuilder.of(XJC_OPTIONS_AUTOMATIC_NAME_CONFLICT_RESOLUTION_ENABLED_CONFIG, ConfigDef.Type.BOOLEAN)
              .documentation(XJC_OPTIONS_AUTOMATIC_NAME_CONFLICT_RESOLUTION_ENABLED_DOC)
              .importance(ConfigDef.Importance.LOW)
              .defaultValue(options.automaticNameConflictResolution)
              .build()
      ).define(
          ConfigKeyBuilder.of(XJC_OPTIONS_VERBOSE_CONFIG, ConfigDef.Type.BOOLEAN)
              .documentation(XJC_OPTIONS_VERBOSE_DOC)
              .importance(ConfigDef.Importance.LOW)
              .defaultValue(options.verbose)
              .build()
      );
}
 
Example #5
Source File: CxfWSDLImporter.java    From flowable-engine with Apache License 2.0 5 votes vote down vote up
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);
    }
}