001: package org.geotools.xml;
002:
003: import java.util.Collection;
004: import java.util.HashMap;
005: import java.util.Map;
006: import java.util.Set;
007:
008: /**
009: * Hint object with known parameters for XML parsing.
010: *
011: * @author Jesse
012: */
013: public class XMLHandlerHints implements Map {
014:
015: /**
016: * Declares the schemas to use for parsing.
017: * Value must be a java.util.Map of <String,URI> objects
018: * where String is the Namespace and URI is the URL to use to load the schema.
019: */
020: public static final String NAMESPACE_MAPPING = "NAMESPACE_MAPPING";
021: /** Declares a FlowHandler for the parser to use */
022: public final static String FLOW_HANDLER_HINT = "FLOW_HANDLER_HINT";
023: /** Tells the parser to "Stream" */
024: public static final String STREAM_HINT = "org.geotools.xml.gml.STREAM_HINT";
025: /** Sets the level of compliance that the filter encoder should use */
026: public static final String FILTER_COMPLIANCE_STRICTNESS = "org.geotools.xml.filter.FILTER_COMPLIANCE_STRICTNESS";
027: /**
028: * The value so that the parser will encode all Geotools filters with no modifications.
029: */
030: public static final Integer VALUE_FILTER_COMPLIANCE_LOW = new Integer(
031: 0);
032: /**
033: * The value so the parser will be slightly more compliant to the Filter 1.0.0 spec.
034: * It will encode:
035: *
036: * <pre><code>
037: * BBoxFilter
038: * or
039: * FidFilter
040: * </code></pre>
041: *
042: * as
043: *
044: * <pre><code>
045: * <Filter><BBo>...</BBox><FidFilter fid="fid"/></Filter>
046: * </code></pre>
047: *
048: * It will encode:
049: * <pre><code>
050: * BBoxFilter
051: * and
052: * FidFilter
053: * </code></pre>
054: * as
055: *
056: * <pre><code>
057: * <Filter><FidFilter fid="fid"/></Filter>
058: * </code></pre>
059: *
060: * <p><b>IMPORTANT:</b> If this compliance level is used and a non-strict FilterFactory is used to create
061: * the filter then the original filter must be ran on the retrieved feature because this hint will sometimes
062: * cause more features to be returned than is requested. Consider the following filter:
063: *
064: * not(fidFilter).
065: *
066: * this will return all features and so the filtering must be done on the client.
067: * </p>
068: */
069: public static final Integer VALUE_FILTER_COMPLIANCE_MEDIUM = new Integer(
070: 1);
071:
072: /**
073: * The value so the parser will be compliant with the Filter 1.0.0 spec.
074: *
075: * It will throw an exception with filters like:
076: * BBoxFilter
077: * or
078: * FidFilter
079:
080: *
081: * It will encode:
082: * <pre><code>
083: * BBoxFilter
084: * and
085: * FidFilter
086: * </code></pre>
087: * as
088: *
089: * <pre><code>
090: * <Filter><FidFilter fid="fid"/></Filter>
091: * </code></pre>
092: * <p><b>IMPORTANT:</b> If this compliance level is used and a non-strict FilterFactory is used to create
093: * the filter then the original filter must be ran on the retrieved feature because this hint will sometimes
094: * cause more features to be returned than is requested. Consider the following filter:
095: * <p>
096: * not(fidFilter).
097: * </p>
098: * this will return all features and so the filtering must be done on the client.
099: * </p>
100:
101: */
102: public static final Integer VALUE_FILTER_COMPLIANCE_HIGH = new Integer(
103: 2);
104:
105: private Map map = new HashMap();
106:
107: public void clear() {
108: map.clear();
109: }
110:
111: public boolean containsKey(Object key) {
112: return map.containsKey(key);
113: }
114:
115: public boolean containsValue(Object value) {
116: return map.containsValue(value);
117: }
118:
119: public Set entrySet() {
120: return map.entrySet();
121: }
122:
123: public boolean equals(Object o) {
124: return map.equals(o);
125: }
126:
127: public Object get(Object key) {
128: return map.get(key);
129: }
130:
131: public int hashCode() {
132: return map.hashCode();
133: }
134:
135: public boolean isEmpty() {
136: return map.isEmpty();
137: }
138:
139: public Set keySet() {
140: return map.keySet();
141: }
142:
143: public Object put(Object arg0, Object arg1) {
144: return map.put(arg0, arg1);
145: }
146:
147: public void putAll(Map arg0) {
148: map.putAll(arg0);
149: }
150:
151: public Object remove(Object key) {
152: return map.remove(key);
153: }
154:
155: public int size() {
156: return map.size();
157: }
158:
159: public Collection values() {
160: return map.values();
161: }
162:
163: }
|