org.geotools.xml.XSD.getSchemaLocation()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(112)

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

XSD.getSchemaLocation介绍

[英]The location on the local disk of the top level .xsd file which defines the schema.
[中]顶层在本地磁盘上的位置。定义模式的xsd文件。

代码示例

代码示例来源:origin: org.geotools.xsd/gt-core

/**
 * Returns the url to the file definiing hte schema.
 * <p>
 * For schema which are defined by multiple files, this method should return the base schema
 * which includes all other files that define the schema.
 * </p>
 * @deprecated use {@link XSD#getSchemaLocation()}.
 */
public final String getSchemaFileURL() {
  return getXSD().getSchemaLocation();
}

代码示例来源:origin: org.geotools/gt2-xml-core

/**
 * Returns the url to the file definiing hte schema.
 * <p>
 * For schema which are defined by multiple files, this method should return the base schema
 * which includes all other files that define the schema.
 * </p>
 * @deprecated use {@link XSD#getSchemaLocation()}.
 */
public final String getSchemaFileURL() {
  return getXSD().getSchemaLocation();
}

代码示例来源:origin: org.geotools/gt2-xml-core

/**
 * Builds the schema from the .xsd file specified by {@link #getSchemaLocation()}
 * <p>
 * This method may be extended, but should not be overridden.
 * </p>
 */
protected XSDSchema buildSchema() throws IOException {
  //grab all the dependencies and create schema locators from the build
  // schemas
  List locators = new ArrayList();
  List resolvers = new ArrayList();
  for (Iterator d = allDependencies().iterator(); d.hasNext();) {
    XSD dependency = (XSD) d.next();
    SchemaLocator locator = dependency.createSchemaLocator();
    if (locator != null) {
      locators.add(locator);
    }
    SchemaLocationResolver resolver = dependency.createSchemaLocationResolver();
    if (resolver != null) {
      resolvers.add(resolver);
    }
  }
  SchemaLocationResolver resolver = createSchemaLocationResolver();
  if (resolver != null) {
    resolvers.add(resolver);
  }
  //parse the location of the xsd with all the locators for dependent
  // schemas
  return Schemas.parse(getSchemaLocation(), locators, resolvers);
}

代码示例来源:origin: org.geotools.xsd/gt-core

/**
 * Builds the schema from the .xsd file specified by {@link #getSchemaLocation()}
 * <p>
 * This method may be extended, but should not be overridden.
 * </p>
 */
protected XSDSchema buildSchema() throws IOException {
  //grab all the dependencies and create schema locators from the build
  // schemas
  List locators = new ArrayList();
  List resolvers = new ArrayList();
  for (Iterator d = allDependencies().iterator(); d.hasNext();) {
    XSD dependency = (XSD) d.next();
    SchemaLocator locator = dependency.createSchemaLocator();
    if (locator != null) {
      locators.add(locator);
    }
    SchemaLocationResolver resolver = dependency.createSchemaLocationResolver();
    if (resolver != null) {
      resolvers.add(resolver);
    }
  }
  SchemaLocationResolver resolver = createSchemaLocationResolver();
  if (resolver != null) {
    resolvers.add(resolver);
  }
  //parse the location of the xsd with all the locators for dependent
  // schemas
  return Schemas.parse(getSchemaLocation(), locators, resolvers);
}

代码示例来源:origin: org.geotools/gt-app-schema

/**
   * Test that a schema known to be in the catalog is resolved to the expected local file.
   */
  @Test
  public void testCatalogSchemaResolution() throws Exception {
    URL catalogLocation = getClass().getResource(schemaBase + "mappedPolygons.oasis.xml");
    String namespace = "http://www.cgi-iugs.org/xml/GeoSciML/2";
    String schemaLocation = "http://schemas.opengis.net/GeoSciML/geosciml.xsd";
    Configuration config = new AppSchemaConfiguration(namespace, schemaLocation,
        new AppSchemaResolver(AppSchemaCatalog.build(catalogLocation)));
    String resolvedSchemaLocation = config.getXSD().getSchemaLocation();
    assertTrue(resolvedSchemaLocation.startsWith("file:/"));
    assertTrue(resolvedSchemaLocation.endsWith(schemaBase
        + "commonSchemas_new/GeoSciML/geosciml.xsd"));
  }
}

相关文章