javax.wsdl.extensions.schema.Schema.getDocumentBaseURI()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中javax.wsdl.extensions.schema.Schema.getDocumentBaseURI()方法的一些代码示例,展示了Schema.getDocumentBaseURI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Schema.getDocumentBaseURI()方法的具体详情如下:
包路径:javax.wsdl.extensions.schema.Schema
类名称:Schema
方法名:getDocumentBaseURI

Schema.getDocumentBaseURI介绍

[英]Get the document base URI of this schema
[中]获取此架构的文档库URI

代码示例

代码示例来源:origin: wsdl4j/wsdl4j

if (schema.getDocumentBaseURI() != null) 
 this.allSchemas.put(schema.getDocumentBaseURI(), schema);
            (schema.getDocumentBaseURI() == null
             ? "'."
             : "', relative to '" + 
             schema.getDocumentBaseURI() + "'."));
    schema.getDocumentBaseURI(), schemaRef.getSchemaLocationURI());
          + schemaRef.getSchemaLocationURI() 
          + "' relative to document base '"
          + schema.getDocumentBaseURI() + "'");
    String contextURI = schema.getDocumentBaseURI();
    URL contextURL = (contextURI != null) ? StringUtils.getURL(null, contextURI) : null;
    URL url = StringUtils.getURL(contextURL, schemaRef.getSchemaLocationURI());
        + schemaRef.getSchemaLocationURI() 
        + "'"
       + (schema.getDocumentBaseURI() == null ? "." : ", relative to '"
       + schema.getDocumentBaseURI() + "'."),
        e);

代码示例来源:origin: com.consol.citrus/citrus-core

/**
 * Recursively add all included schemas as schema resource.
 */
protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError {
  List<SchemaReference> includes = schema.getIncludes();
  for (SchemaReference schemaReference : includes) {
    String schemaLocation;
    URI locationURI = URI.create(schemaReference.getSchemaLocationURI());
    if (locationURI.isAbsolute()) {
      schemaLocation = schemaReference.getSchemaLocationURI();
    } else {
      schemaLocation = schema.getDocumentBaseURI().substring(0, schema.getDocumentBaseURI().lastIndexOf('/') + 1) + schemaReference.getSchemaLocationURI();
    }
    schemaResources.add(new FileSystemResource(schemaLocation));
  }
}

代码示例来源:origin: apache/cxf

private void getSchemaList(Definition def) {
  Types typesElement = def.getTypes();
  if (typesElement != null) {
    Iterator<?> ite = typesElement.getExtensibilityElements().iterator();
    while (ite.hasNext()) {
      Object obj = ite.next();
      if (obj instanceof Schema) {
        Schema schema = (Schema)obj;
        addSchema(schema.getDocumentBaseURI(), schema);
      }
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

private void getSchemaList(Definition def) {
  Types typesElement = def.getTypes();
  if (typesElement != null) {
    Iterator<?> ite = typesElement.getExtensibilityElements().iterator();
    while (ite.hasNext()) {
      Object obj = ite.next();
      if (obj instanceof Schema) {
        Schema schema = (Schema)obj;
        addSchema(schema.getDocumentBaseURI(), schema);
      }
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-rt-databinding-jibx

private void getSchemaList(Definition def) {
  Types typesElement = def.getTypes();
  if (typesElement != null) {
    Iterator<?> ite = typesElement.getExtensibilityElements().iterator();
    while (ite.hasNext()) {
      Object obj = ite.next();
      if (obj instanceof Schema) {
        Schema schema = (Schema)obj;
        addSchema(schema.getDocumentBaseURI(), schema);
      }
    }
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-cxf-bc

private void getSchemaList(Definition def) {
  Types typesElement = def.getTypes();
  if (typesElement != null) {
    Iterator ite = typesElement.getExtensibilityElements().iterator();
    while (ite.hasNext()) {
      Object obj = ite.next();
      if (obj instanceof Schema) {
        Schema schema = (Schema)obj;
        addSchema(schema.getDocumentBaseURI(), schema);
      }
    }
  }
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

private void getSchemaList(Definition def) {
  Types typesElement = def.getTypes();
  if (typesElement != null) {
    Iterator<?> ite = typesElement.getExtensibilityElements().iterator();
    while (ite.hasNext()) {
      Object obj = ite.next();
      if (obj instanceof Schema) {
        Schema schema = (Schema)obj;
        addSchema(schema.getDocumentBaseURI(), schema);
      }
    }
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-cxf-se

private void getSchemaList(Definition def) {
  Types typesElement = def.getTypes();
  if (typesElement != null) {
    Iterator ite = typesElement.getExtensibilityElements().iterator();
    while (ite.hasNext()) {
      Object obj = ite.next();
      if (obj instanceof Schema) {
        Schema schema = (Schema)obj;
        addSchema(schema.getDocumentBaseURI(), schema);
      }
    }
  }
}

代码示例来源:origin: apache/cxf

String tns = schema.getDocumentBaseURI() + "#"
       + schema.getElement().getAttribute("targetNamespace");
if (schemaList.get(tns) == null) {
    String key = schemaImport.getSchemaLocationURI();
    if (importNamespace == null && tempImport != null) {
      importNamespace = tempImport.getDocumentBaseURI();
      key = tempImport.getDocumentBaseURI();

代码示例来源:origin: org.apache.cxf/cxf-rt-core

String tns = schema.getDocumentBaseURI() + "#"
       + schema.getElement().getAttribute("targetNamespace");
if (schemaList.get(tns) == null) {
    String key = schemaImport.getSchemaLocationURI();
    if (importNamespace == null && tempImport != null) {
      importNamespace = tempImport.getDocumentBaseURI();
      key = tempImport.getDocumentBaseURI();

代码示例来源:origin: org.objectweb.celtix/celtix-tools

@SuppressWarnings("unchecked")
private void addSchema(Schema schema) {
  Map<String, List> imports = schema.getImports();
  if (imports != null && imports.size() > 0) {
    Collection<String> importKeys = imports.keySet();
    for (String importNamespace : importKeys) {
      if (!isSchemaParsed(importNamespace + "?file=" + schema.getDocumentBaseURI())) {
        List<SchemaImport> schemaImports = imports.get(importNamespace);
        for (SchemaImport schemaImport : schemaImports) {
          Schema tempImport = schemaImport.getReferencedSchema();
          if (tempImport != null && !isSchemaImported(tempImport)) {
            addSchema(tempImport);
          }
        }
      }
    }
  }
  if (!isSchemaImported(schema)) {
    schemaList.add(schema);
  }
}

代码示例来源:origin: org.apache.servicemix/servicemix-common

private void parseSchemas(Definition def) throws Exception {
  if (def.getTypes() != null && def.getTypes().getExtensibilityElements() != null) {
    for (Iterator iter = def.getTypes().getExtensibilityElements().iterator(); iter.hasNext();) {
      ExtensibilityElement element = (ExtensibilityElement) iter.next();
      if (element instanceof javax.wsdl.extensions.schema.Schema) {
        javax.wsdl.extensions.schema.Schema schema = (javax.wsdl.extensions.schema.Schema) element;
        if (schema.getElement() != null) {
          schemas.read(schema.getElement(), getUri(schema.getDocumentBaseURI()));
        }
        for (Iterator itImp = schema.getImports().values().iterator(); itImp.hasNext();) {
          Collection imps = (Collection) itImp.next();
          for (Iterator itSi = imps.iterator(); itSi.hasNext();) {
            SchemaImport imp = (SchemaImport) itSi.next();
            schemas.read(imp.getSchemaLocationURI(), getUri(def.getDocumentBaseURI()));
          }
        }
      }
    }
  }
  if (def.getImports() != null) {
    for (Iterator itImp = def.getImports().values().iterator(); itImp.hasNext();) {
      Collection imps = (Collection) itImp.next();
      for (Iterator iter = imps.iterator(); iter.hasNext();) {
        Import imp = (Import) iter.next();
        parseSchemas(imp.getDefinition());
      }
    }
  }
}

代码示例来源:origin: org.apache.ode/ode-jbi

private void parseSchemas(Definition def) throws Exception {
  if (def.getTypes() != null && def.getTypes().getExtensibilityElements() != null) {
    for (Iterator iter = def.getTypes().getExtensibilityElements().iterator(); iter.hasNext();) {
      ExtensibilityElement element = (ExtensibilityElement) iter.next();
      if (element instanceof javax.wsdl.extensions.schema.Schema) {
        javax.wsdl.extensions.schema.Schema schema = (javax.wsdl.extensions.schema.Schema) element;
        if (schema.getElement() != null) {
          _schemas.read(schema.getElement(), getUri(schema.getDocumentBaseURI()));
        }
        for (Iterator itImp = schema.getImports().values().iterator(); itImp.hasNext();) {
          Collection imps = (Collection) itImp.next();
          for (Iterator itSi = imps.iterator(); itSi.hasNext();) {
            SchemaImport imp = (SchemaImport) itSi.next();
            _schemas.read(imp.getSchemaLocationURI(), getUri(def.getDocumentBaseURI()));
          }
        }
      }
    }
  }
  if (def.getImports() != null) {
    for (Iterator itImp = def.getImports().values().iterator(); itImp.hasNext();) {
      Collection imps = (Collection) itImp.next();
      for (Iterator iter = imps.iterator(); iter.hasNext();) {
        Import imp = (Import) iter.next();
        parseSchemas(imp.getDefinition());
      }
    }
  }
}

代码示例来源:origin: apache/cxf

SchemaReference si = lookupSchemaReference(bus, xsd, smp, base);
String uri = si.getReferencedSchema().getDocumentBaseURI();
uri = resolveWithCatalogs(OASISCatalogManager.getCatalogManager(bus),
  uri, si.getReferencedSchema().getDocumentBaseURI());
if (uri == null) {
  uri = si.getReferencedSchema().getDocumentBaseURI();

代码示例来源:origin: org.apache.cxf/cxf-rt-frontend-simple

SchemaReference si = lookupSchemaReference(bus, xsd, smp, base);
String uri = si.getReferencedSchema().getDocumentBaseURI();
uri = resolveWithCatalogs(OASISCatalogManager.getCatalogManager(bus),
  uri, si.getReferencedSchema().getDocumentBaseURI());
if (uri == null) {
  uri = si.getReferencedSchema().getDocumentBaseURI();

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions

new File(schemaImport.getReferencedSchema().getDocumentBaseURI()).toString());

代码示例来源:origin: apache/cxf

private void addSchemaImport(Schema schema, SchemaInfo schemaInfo, Schema referencedSchema) {
  SchemaImport imp = schema.createImport();
  imp.setId(schemaInfo.getSystemId());
  imp.setNamespaceURI(schemaInfo.getNamespaceURI());
  imp.setSchemaLocationURI(referencedSchema.getDocumentBaseURI());
  imp.setReferencedSchema(referencedSchema);
  schema.addImport(imp);
}

代码示例来源:origin: org.apache.cxf/cxf-rt-core

private void addSchemaImport(Schema schema, SchemaInfo schemaInfo, Schema referencedSchema) {
  SchemaImport imp = schema.createImport();
  imp.setId(schemaInfo.getSystemId());
  imp.setNamespaceURI(schemaInfo.getNamespaceURI());
  imp.setSchemaLocationURI(referencedSchema.getDocumentBaseURI());
  imp.setReferencedSchema(referencedSchema);
  schema.addImport(imp);
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

private void addSchemaImport(Schema schema, SchemaInfo schemaInfo, Schema referencedSchema) {
  SchemaImport imp = schema.createImport();
  imp.setId(schemaInfo.getSystemId());
  imp.setNamespaceURI(schemaInfo.getNamespaceURI());
  imp.setSchemaLocationURI(referencedSchema.getDocumentBaseURI());
  imp.setReferencedSchema(referencedSchema);
  schema.addImport(imp);
}

代码示例来源:origin: org.codehaus.service-conduit/sca4j-interface-wsdl

private XmlSchemaCollection getXmlSchema(Definition definition) {
  
  XmlSchemaCollection collection = new XmlSchemaCollection();
  Types types = definition.getTypes();
  collection.setSchemaResolver(new URIResolver( ) {
    @Override
    public InputSource resolveEntity(String targetNamespace, String schemaLocation, String baseUri) {
      return new InputSource(getClass().getClassLoader().getResourceAsStream(schemaLocation));
    }
  });
  if (types != null) {
    for(Object obj : types.getExtensibilityElements()) {
      if(obj instanceof Schema) {
        Schema schema = (Schema) obj;
        Element element = schema.getElement();
        collection.setBaseUri(schema.getDocumentBaseURI());
        collection.read(element);
      }
    }
  }
  return collection;
  
}

相关文章