本文整理了Java中org.geotools.xml.XSD.getSchemaLocation()
方法的一些代码示例,展示了XSD.getSchemaLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSD.getSchemaLocation()
方法的具体详情如下:
包路径:org.geotools.xml.XSD
类名称: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"));
}
}
内容来源于网络,如有侵权,请联系作者删除!