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.gml3.bindings;
17:
18: import org.eclipse.xsd.XSDSchema;
19: import org.eclipse.xsd.util.XSDSchemaLocationResolver;
20: import org.picocontainer.MutablePicoContainer;
21: import java.net.MalformedURLException;
22: import java.net.URL;
23: import org.geotools.gml3.GMLConfiguration;
24: import org.geotools.xml.BindingConfiguration;
25: import org.geotools.xml.Configuration;
26:
27: public class TestConfiguration extends Configuration {
28: public TestConfiguration() {
29: addDependency(new GMLConfiguration());
30: }
31:
32: public String getNamespaceURI() {
33: return TEST.NAMESPACE;
34: }
35:
36: public String getSchemaFileURL() {
37: return getClass().getResource("test.xsd").toString();
38: }
39:
40: public BindingConfiguration getBindingConfiguration() {
41: return new BindingConfiguration() {
42: public void configure(MutablePicoContainer container) {
43: //no bindings
44: }
45: };
46: }
47:
48: public XSDSchemaLocationResolver getSchemaLocationResolver() {
49: return new XSDSchemaLocationResolver() {
50: public String resolveSchemaLocation(XSDSchema schema,
51: String namespaceURI, String schemaLocationURI) {
52: if (getNamespaceURI().equals(namespaceURI)) {
53: return getSchemaFileURL().toString();
54: }
55:
56: return null;
57: }
58: };
59: }
60: }
|