01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.gml2;
17:
18: import org.eclipse.xsd.XSDSchema;
19: import org.eclipse.xsd.util.XSDSchemaLocationResolver;
20: import org.picocontainer.MutablePicoContainer;
21: import org.geotools.xml.BindingConfiguration;
22: import org.geotools.xml.Configuration;
23:
24: public class TestConfiguration extends Configuration {
25: public TestConfiguration() {
26: addDependency(new GMLConfiguration());
27: }
28:
29: public String getNamespaceURI() {
30: return TEST.NAMESPACE;
31: }
32:
33: public String getSchemaFileURL() {
34: return getClass().getResource("test.xsd").toString();
35: }
36:
37: public BindingConfiguration getBindingConfiguration() {
38: return new BindingConfiguration() {
39: public void configure(MutablePicoContainer container) {
40: //no bindings
41: }
42: };
43: }
44:
45: public XSDSchemaLocationResolver getSchemaLocationResolver() {
46: return new XSDSchemaLocationResolver() {
47: public String resolveSchemaLocation(XSDSchema schema,
48: String namespaceURI, String schemaLocationURI) {
49: if (getNamespaceURI().equals(namespaceURI)) {
50: return getSchemaFileURL().toString();
51: }
52:
53: return null;
54: }
55: };
56: }
57: }
|