本文整理了Java中org.geotools.xs.XSConfiguration
类的一些代码示例,展示了XSConfiguration
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSConfiguration
类的具体详情如下:
包路径:org.geotools.xs.XSConfiguration
类名称:XSConfiguration
[英]Parser configuration for xml schema schema.
[中]xml模式的解析器配置。
代码示例来源:origin: geotools/geotools
/**
* Creates a new configuration.
*
* <p>Any dependent schemas should be added in subclass constructor. The xml schema dependency
* does not have to be added.
*/
public Configuration(XSD xsd) {
this.xsd = xsd;
dependencies = Collections.synchronizedList(new ArrayList());
// bootstrap check
if (!(this instanceof XSConfiguration)) {
dependencies.add(new XSConfiguration());
}
properties = Collections.synchronizedSet(new HashSet());
context = new DefaultPicoContainer();
}
代码示例来源:origin: geotools/geotools
@Override
protected void setUp() throws Exception {
XSConfiguration xs = new XSConfiguration();
p = new Parser(xs);
}
代码示例来源:origin: geotools/geotools
public void testWhitespace() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(getClass().getResourceAsStream("whitespace.xml"));
String schemaLocation =
"http://geotools.org/test " + getClass().getResource("facets.xsd").getFile();
doc.getDocumentElement()
.setAttributeNS(
"http://www.w3.org/2001/XMLSchema-instance",
"schemaLocation",
schemaLocation);
DOMParser parser = new DOMParser(new XSConfiguration(), doc);
String s = (String) parser.parse();
assertEquals("this is a normal string with some whitespace and some new lines", s);
}
代码示例来源:origin: geotools/geotools
public ApplicationSchemaConfiguration(String namespace, String schemaLocation) {
super(new ApplicationSchemaXSD(namespace, schemaLocation));
addDependency(new XSConfiguration());
addDependency(new GMLConfiguration());
}
代码示例来源:origin: geotools/geotools
public void testCDATAWhitespace() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(getClass().getResourceAsStream("whitespace-cdata.xml"));
String schemaLocation =
"http://geotools.org/test " + getClass().getResource("facets.xsd").getFile();
doc.getDocumentElement()
.setAttributeNS(
"http://www.w3.org/2001/XMLSchema-instance",
"schemaLocation",
schemaLocation);
DOMParser parser = new DOMParser(new XSConfiguration(), doc);
String s = (String) parser.parse();
assertEquals(
" this is a \n"
+ " normal string \n"
+ " with some whitespace and \n"
+ " some new lines",
s);
}
}
代码示例来源:origin: geotools/geotools
public void testList() throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(getClass().getResourceAsStream("list.xml"));
String schemaLocation =
"http://geotools.org/test " + getClass().getResource("facets.xsd").getFile();
doc.getDocumentElement()
.setAttributeNS(
"http://www.w3.org/2001/XMLSchema-instance",
"schemaLocation",
schemaLocation);
DOMParser parser = new DOMParser(new XSConfiguration(), doc);
Object o = parser.parse();
assertTrue(o instanceof List);
List list = (List) o;
assertEquals(3, list.size());
assertEquals(Integer.valueOf(1), list.get(0));
assertEquals(Integer.valueOf(2), list.get(1));
assertEquals(Integer.valueOf(3), list.get(2));
}
代码示例来源:origin: geotools/geotools
public TestConfiguration() {
super(new TEST());
addDependency(new XSConfiguration());
}
}
代码示例来源:origin: geotools/geotools
new Configuration(xsd) {
addDependency(new XSConfiguration());
代码示例来源:origin: org.geotools/gt2-xml-xsd
/**
* Creates a new configuration.
* <p>
* Any dependent schemas should be added in sublcass constructor. The xml schema
* dependency does not have to be added.
* </p>
*
*/
public Configuration() {
dependencies = new ArrayList();
//bootstrap check
if ( !( this instanceof XSConfiguration ) ) {
dependencies.add( new XSConfiguration() );
}
properties = Collections.synchronizedList(new ArrayList());
}
代码示例来源:origin: org.geotools/gt2-xml-core
/**
* Creates a new configuration.
* <p>
* Any dependent schemas should be added in sublcass constructor. The xml schema
* dependency does not have to be added.
* </p>
*
*/
public Configuration(XSD xsd) {
this.xsd = xsd;
dependencies = new ArrayList();
//bootstrap check
if (!(this instanceof XSConfiguration)) {
dependencies.add(new XSConfiguration());
}
properties = new ArrayList();
}
代码示例来源:origin: org.geotools.xsd/gt-core
/**
* Creates a new configuration.
* <p>
* Any dependent schemas should be added in sublcass constructor. The xml schema
* dependency does not have to be added.
* </p>
*
*/
public Configuration(XSD xsd) {
this.xsd = xsd;
dependencies = new ArrayList();
//bootstrap check
if (!(this instanceof XSConfiguration)) {
dependencies.add(new XSConfiguration());
}
properties = Collections.synchronizedList(new ArrayList());
context = new DefaultPicoContainer();
}
代码示例来源:origin: org.geotools/gt2-xml-gml3
public ApplicationSchemaConfiguration(String namespace, String schemaLocation) {
assert namespace != null;
assert schemaLocation != null;
this.namespace = namespace;
this.schemaLocation = schemaLocation;
addDependency(new XSConfiguration());
addDependency(new GMLConfiguration());
}
代码示例来源:origin: org.geotools.xsd/gt-xsd-gml3
public ApplicationSchemaConfiguration(String namespace, String schemaLocation) {
super(new ApplicationSchemaXSD(namespace, schemaLocation));
addDependency(new XSConfiguration());
addDependency(new GMLConfiguration());
}
代码示例来源:origin: org.geotools.xsd/gt-gml3
public ApplicationSchemaConfiguration(String namespace, String schemaLocation) {
super(new ApplicationSchemaXSD(namespace, schemaLocation));
addDependency(new XSConfiguration());
addDependency(new GMLConfiguration());
}
内容来源于网络,如有侵权,请联系作者删除!