Source Code Cross Referenced for QueryTypeBinding.java in  » GIS » GeoServer » org » geoserver » wfs » xml » v1_0_0 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoServer » org.geoserver.wfs.xml.v1_0_0 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.geoserver.wfs.xml.v1_0_0;
006:
007:        import net.opengis.wfs.QueryType;
008:        import net.opengis.wfs.WfsFactory;
009:
010:        import org.geoserver.wfs.WFSException;
011:        import org.geotools.gml2.bindings.GML2ParsingUtils;
012:        import org.geotools.xml.AbstractComplexBinding;
013:        import org.geotools.xml.ElementInstance;
014:        import org.geotools.xml.Node;
015:        import org.opengis.filter.Filter;
016:        import org.opengis.filter.expression.PropertyName;
017:        import org.opengis.referencing.crs.CoordinateReferenceSystem;
018:        import org.picocontainer.MutablePicoContainer;
019:        import org.xml.sax.helpers.NamespaceSupport;
020:
021:        import java.net.URI;
022:        import java.util.ArrayList;
023:        import java.util.Iterator;
024:        import java.util.List;
025:        import javax.xml.namespace.QName;
026:
027:        /**
028:         * Binding object for the type http://www.opengis.net/wfs:QueryType.
029:         *
030:         * <p>
031:         *        <pre>
032:         *         <code>
033:         *  &lt;xsd:complexType name="QueryType"&gt;
034:         *                  &lt;xsd:annotation&gt;
035:         *              &lt;xsd:documentation&gt;
036:         *              The Query element is of type
037:         *              QueryType.
038:         *              &lt;/xsd:documentation&gt;
039:         *      &lt;/xsd:annotation&gt;
040:         *      &lt;xsd:sequence&gt;
041:         *                      &lt;xsd:element
042:         *              maxOccurs="unbounded" minOccurs="0" ref="ogc:PropertyName"&gt;
043:         *                  &lt;xsd:annotation&gt;              &lt;xsd:documentation&gt;
044:         *                      The PropertyName element is used to specify one or
045:         *                      more                 properties of a feature whose
046:         *                      values are to be retrieved                 by a Web
047:         *                      Feature Service.
048:         *                      While a Web Feature Service should endeavour to
049:         *                      satisfy                 the exact request specified,
050:         *                      in some instance this may                 not be
051:         *                      possible.  Specifically, a Web Feature Service
052:         *                      must generate a valid GML2 response to a Query
053:         *                      operation.                 The schema used to
054:         *                      generate the output may include
055:         *                      properties that are mandatory.  In order that the
056:         *                      output                 validates, these mandatory
057:         *                      properties must be specified                 in the
058:         *                      request.  If they are not, a Web Feature Service
059:         *                      may add them automatically to the Query before
060:         *                      processing                 it.  Thus a client
061:         *                      application should, in general, be
062:         *                      prepared to receive more properties than it
063:         *                      requested.                  Of course, using the
064:         *                      DescribeFeatureType request, a client
065:         *                      application can determine which properties are
066:         *                      mandatory                 and request them in the
067:         *                      first place.              &lt;/xsd:documentation&gt;
068:         *              &lt;/xsd:annotation&gt;        &lt;/xsd:element&gt;        &lt;xsd:element
069:         *              maxOccurs="1" minOccurs="0" ref="ogc:Filter"&gt;
070:         *                  &lt;xsd:annotation&gt;              &lt;xsd:documentation&gt;
071:         *                      The Filter element is used to define spatial and/or
072:         *                      non-spatial                 constraints on query.
073:         *                      Spatial constrains use GML2 to specify
074:         *                      the constraining geometry.  A full description of
075:         *                      the Filter                 element can be found in
076:         *                      the Filter Encoding Implementation
077:         *                      Specification.              &lt;/xsd:documentation&gt;
078:         *              &lt;/xsd:annotation&gt;        &lt;/xsd:element&gt;      &lt;/xsd:sequence&gt;
079:         *          &lt;xsd:attribute name="handle" type="xsd:string" use="optional"/&gt;
080:         *          &lt;xsd:attribute name="typeName" type="xsd:QName" use="required"/&gt;
081:         *          &lt;xsd:attribute name="featureVersion" type="xsd:string"
082:         *          use="optional"&gt;         &lt;xsd:annotation&gt;
083:         *                  &lt;xsd:documentation&gt;               For systems that
084:         *                  implement versioning, the featureVersion
085:         *                  attribute is used to specify which version of a
086:         *                  particular               feature instance is to be
087:         *                  retrieved.  A value of ALL means               that all
088:         *                  versions should be retrieved.  An integer value
089:         *                  &apos;i&apos;, means that the ith version should be
090:         *                  retrieve if it               exists or the most recent
091:         *                  version otherwise.            &lt;/xsd:documentation&gt;
092:         *          &lt;/xsd:annotation&gt;      &lt;/xsd:attribute&gt;    &lt;/xsd:complexType&gt;
093:         *
094:         *          </code>
095:         *         </pre>
096:         * </p>
097:         *
098:         * @generated
099:         */
100:        public class QueryTypeBinding extends AbstractComplexBinding {
101:            /**
102:             * Wfs Factory
103:             */
104:            WfsFactory wfsfactory;
105:
106:            /**
107:             * namespace mappings
108:             */
109:            NamespaceSupport namespaceSupport;
110:
111:            public QueryTypeBinding(WfsFactory wfsfactory,
112:                    NamespaceSupport namespaceSupport) {
113:                this .wfsfactory = wfsfactory;
114:                this .namespaceSupport = namespaceSupport;
115:            }
116:
117:            /**
118:             * @generated
119:             */
120:            public QName getTarget() {
121:                return WFS.QUERYTYPE;
122:            }
123:
124:            /**
125:             * <!-- begin-user-doc -->
126:             * <!-- end-user-doc -->
127:             *
128:             * @generated modifiable
129:             */
130:            public Class getType() {
131:                return QueryType.class;
132:            }
133:
134:            public void initializeChildContext(ElementInstance childInstance,
135:                    Node node, MutablePicoContainer context) {
136:                //if an srsName is set for this geometry, put it in the context for
137:                // children, so they can use it as well
138:                if (node.hasAttribute("srsName")) {
139:                    try {
140:                        CoordinateReferenceSystem crs = GML2ParsingUtils
141:                                .crs(node);
142:                        if (crs != null) {
143:                            context.registerComponentInstance(
144:                                    CoordinateReferenceSystem.class, crs);
145:                        }
146:                    } catch (Exception e) {
147:                        throw new WFSException(e, "InvalidParameterValue");
148:                    }
149:                }
150:            }
151:
152:            /**
153:             * <!-- begin-user-doc -->
154:             * <!-- end-user-doc -->
155:             *
156:             * @generated modifiable
157:             */
158:            public Object parse(ElementInstance instance, Node node,
159:                    Object value) throws Exception {
160:                QueryType queryType = wfsfactory.createQueryType();
161:
162:                //<xsd:element maxOccurs="unbounded" minOccurs="0" ref="ogc:PropertyName">
163:                //JD:difference in spec here, moved from ogc:PropertyName to string
164:                List propertyNames = node.getChildValues(PropertyName.class);
165:
166:                for (Iterator p = propertyNames.iterator(); p.hasNext();) {
167:                    PropertyName propertyName = (PropertyName) p.next();
168:                    queryType.getPropertyName().add(
169:                            propertyName.getPropertyName());
170:                }
171:
172:                //<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
173:                Filter filter = (Filter) node.getChildValue(Filter.class);
174:
175:                if (filter == null) {
176:                    filter = (Filter) Filter.INCLUDE;
177:                }
178:
179:                queryType.setFilter(filter);
180:
181:                //<xsd:attribute name="handle" type="xsd:string" use="optional"/>
182:                queryType.setHandle((String) node.getAttributeValue("handle"));
183:
184:                //<xsd:attribute name="typeName" type="xsd:QName" use="required"/>
185:                List typeNameList = new ArrayList();
186:                typeNameList.add(node.getAttributeValue("typeName"));
187:                queryType.setTypeName(typeNameList);
188:
189:                //<xsd:attribute name="featureVersion" type="xsd:string" use="optional">  
190:                queryType.setFeatureVersion((String) node
191:                        .getAttributeValue("featureVersion"));
192:
193:                //JD: even though reprojection is not supported in 1.0 we handle it 
194:                // anyways
195:                //&lt;xsd:attribute name="srsName" type="xsd:anyURI" use="optional"&gt;
196:                if (node.hasAttribute("srsName")) {
197:                    queryType.setSrsName(new URI((String) node
198:                            .getAttributeValue("srsName")));
199:                }
200:
201:                return queryType;
202:            }
203:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.