01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.geoserver.ows.xml.v1_0;
06:
07: import net.opengis.ows.OwsFactory;
08: import org.eclipse.xsd.util.XSDSchemaLocationResolver;
09: import org.geotools.xlink.XLINKConfiguration;
10: import org.geotools.xml.BindingConfiguration;
11: import org.geotools.xml.Configuration;
12: import org.picocontainer.MutablePicoContainer;
13:
14: /**
15: * Parser configuration for ows schema.
16: *
17: * @author Justin Deoliveira, The Open Planning Project
18: *
19: */
20: public class OWSConfiguration extends Configuration {
21: /**
22: * Creates a new configuration, adding the dependency on {@link OWSConfiguration}.
23: */
24: public OWSConfiguration() {
25: super ();
26:
27: addDependency(new XLINKConfiguration());
28: }
29:
30: /**
31: * @return {@link OWS#NAMESPACE}, http://www.opengis.net/ows
32: */
33: public String getNamespaceURI() {
34: return OWS.NAMESPACE;
35: }
36:
37: /**
38: * @return the owsAll.xsd file of the ows schema.
39: */
40: public String getSchemaFileURL() {
41: return getSchemaLocationResolver().resolveSchemaLocation(null,
42: getNamespaceURI(), "owsAll.xsd");
43: }
44:
45: /**
46: * @return A new instance of {@link OWSBindingConfiguration}.
47: */
48: public BindingConfiguration getBindingConfiguration() {
49: return new OWSBindingConfiguration();
50: }
51:
52: /**
53: * @return A new instance of {@link OWSSchemaLocationResolver}.
54: */
55: public XSDSchemaLocationResolver getSchemaLocationResolver() {
56: return new OWSSchemaLocationResolver();
57: }
58:
59: /**
60: * Configures the ows context.
61: * <p>
62: * The following factories are registered:
63: * <ul>
64: * <li>{@link OwsFactory}
65: * </ul>
66: * </p>
67: */
68: protected void configureContext(MutablePicoContainer container) {
69: super.configureContext(container);
70:
71: container.registerComponentInstance(OwsFactory.eINSTANCE);
72: }
73: }
|