本文整理了Java中org.geotools.xml.XSD.getSchema()
方法的一些代码示例,展示了XSD.getSchema()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSD.getSchema()
方法的具体详情如下:
包路径:org.geotools.xml.XSD
类名称:XSD
方法名:getSchema
[英]Returns the XSD object representing the contents of the schema.
[中]返回表示架构内容的XSD对象。
代码示例来源:origin: org.geotools.xsd/gt-core
/**
* Convenience method for creating an instance of the schema for this configuration.
*
* @return The schema for this configuration.
* @deprecated use {@link #getXSD()} and {@link XSD#getSchema()}.
*/
public XSDSchema schema() {
try {
return getXSD().getSchema();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.geotools/gt2-xml-core
/**
* Convenience method for creating an instance of the schema for this configuration.
*
* @return The schema for this configuration.
* @deprecated use {@link #getXSD()} and {@link XSD#getSchema()}.
*/
public XSDSchema schema() {
try {
return getXSD().getSchema();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.geotools.xsd/gt-core
/**
* Creates the schema, returning <code>null</code> if the schema could not be created.
* </p>
* <code>namespaceURI</code> should not be <code>null</code>. All other parameters are ignored.
*
* @see XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema, java.lang.String, java.lang.String, java.lang.String)
*/
public XSDSchema locateSchema(XSDSchema schema, String namespaceURI,
String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
if (canHandle(schema,namespaceURI,rawSchemaLocationURI,resolvedSchemaLocationURI)) {
try {
return xsd.getSchema();
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Error occured getting schema", e);
}
}
return null;
}
代码示例来源:origin: org.geotools/gt2-xml-core
/**
* Creates the schema, returning <code>null</code> if the schema could not be created.
* </p>
* <code>namespaceURI</code> should not be <code>null</code>. All other parameters are ignored.
*
* @see XSDSchemaLocator#locateSchema(org.eclipse.xsd.XSDSchema, java.lang.String, java.lang.String, java.lang.String)
*/
public XSDSchema locateSchema(XSDSchema schema, String namespaceURI,
String rawSchemaLocationURI, String resolvedSchemaLocationURI) {
if (xsd.getNamespaceURI().equals(namespaceURI)) {
try {
return xsd.getSchema();
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Error occured getting schema", e);
}
}
return null;
}
代码示例来源:origin: org.geotools/gt2-xml-core
/**
* Encodes an object, element name pair.
*
* @param object The object to encode.
* @param element The name of the element to encode.
*
* @return The object encoded.
* @throws Exception
*/
protected Document encode(Object object, QName element)
throws Exception {
Configuration configuration = createConfiguration();
XSDSchema schema = configuration.getXSD().getSchema();
Encoder encoder = new Encoder(configuration, schema);
ByteArrayOutputStream output = new ByteArrayOutputStream();
encoder.write(object, element, output);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
return dbf.newDocumentBuilder().parse(new ByteArrayInputStream(output.toByteArray()));
}
代码示例来源:origin: org.geotools.xsd/gt-core
XSDSchema schema = configuration.getXSD().getSchema();
代码示例来源:origin: org.geotools.xsd/gt-core
for (Iterator d = configuration.getXSD().getDependencies().iterator(); d.hasNext();) {
XSD xsd = (XSD) d.next();
XSDSchema schema = xsd.getSchema();
mappings.putAll(configuration.getXSD().getSchema().getQNamePrefixToNamespaceMap());
} catch (IOException e) {
throw new RuntimeException(e);
代码示例来源:origin: org.geotools.xsd/gt-core
schemas = new XSDSchema[] { config.getXSD().getSchema() };
} catch (IOException e) {
throw (SAXException) new SAXException().initCause(e);
内容来源于网络,如有侵权,请联系作者删除!