Source Code Cross Referenced for XmlRequestReader.java in  » GIS » GeoServer » org » geoserver » ows » 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.ows 
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.ows;
006:
007:        import org.apache.commons.lang.builder.EqualsBuilder;
008:        import org.apache.commons.lang.builder.HashCodeBuilder;
009:        import org.geotools.util.Version;
010:        import java.io.Reader;
011:        import java.util.Map;
012:
013:        import javax.xml.namespace.QName;
014:
015:        /**
016:         * Creates a request bean from xml.
017:         * <p>
018:         * A request bean is an object which captures the parameters of an operation
019:         * being requested to a service.
020:         * </p>
021:         * <p>
022:         * An xml request reader must declare the root element of xml documents that it
023:         * is capable of reading. This is accomplished with {@link #getNamespace()} and
024:         * {@link #getElement()}.
025:         * </p>
026:         *
027:         * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
028:         *
029:         */
030:        public abstract class XmlRequestReader {
031:            /**
032:             * the qualified name of the element this reader can read.
033:             */
034:            final QName element;
035:
036:            /**
037:             * Appliction specific version number.
038:             */
039:            final Version version;
040:
041:            /**
042:             * Service identifier
043:             */
044:            final String serviceId;
045:
046:            /**
047:             * Creates the xml reader for the specified element.
048:             *
049:             * @param element The qualified name of the element the reader reads.
050:             */
051:            public XmlRequestReader(QName element) {
052:                this (element, null, null);
053:            }
054:
055:            /**
056:             * Creates the xml reader for the specified element.
057:             *
058:             * @param namespace The namespace of the element
059:             * @param local The local name of the element
060:             */
061:            public XmlRequestReader(String namespace, String local) {
062:                this (new QName(namespace, local));
063:            }
064:
065:            /**
066:             *
067:             * Creates the xml reader for the specified element of a particular version.
068:             *
069:             * @param element The qualified name of the element the reader reads.
070:             * @param version The version of the element in which the reader supports,
071:             * may be <code>null</code>.
072:             */
073:            public XmlRequestReader(QName element, Version version,
074:                    String serviceId) {
075:                this .element = element;
076:                this .version = version;
077:                this .serviceId = serviceId;
078:
079:                if (element == null) {
080:                    throw new NullPointerException("element");
081:                }
082:            }
083:
084:            //    /**
085:            //     *
086:            //     * Creates the xml reader for the specified element of a particular version.
087:            //     *
088:            //     * @param namespace The namespace of the element
089:            //     * @param local The local name of the element
090:            //     * @param version The version of the element in which the reader supports,
091:            //     * may be <code>null</code>.
092:            //     */
093:            //    public XmlRequestReader(String namespace, String local, Version version) {
094:            //        this(new QName(namespace, local), version, null);
095:            //    }
096:
097:            /**
098:             * @return The qualified name of the element that this reader reads.
099:             */
100:            public QName getElement() {
101:                return element;
102:            }
103:
104:            /**
105:             * @return The version of hte element that this reader reads.
106:             */
107:            public Version getVersion() {
108:                return version;
109:            }
110:
111:            /**
112:             * Reads the xml and initializes the request object.
113:             * <p>
114:             * The <tt>request</tt> parameter may be <code>null</code>, so in this case
115:             * the request reader would be responsible for creating the request object, 
116:             * or throwing an exception if this is not supported. 
117:             * </p>
118:             * <p>
119:             * In the case of the <tt>request</tt> being non <code>null</code>, the 
120:             * request reader may chose to modify and return <tt>request</tt>, or create
121:             * a new request object and return it.
122:             * </p>
123:             * <p>
124:             * The <tt>kvp</tt> is used to support mixed style reading of the request 
125:             * object from xml and from a set of key value pairs. This map is often empty. 
126:             * </p>
127:             */
128:            public abstract Object read(Object request, Reader reader, Map kvp)
129:                    throws Exception;
130:
131:            /**
132:             * Two XmlReaders considered equal if namespace,element, and version properties
133:             * are the same.
134:             */
135:            public boolean equals(Object obj) {
136:                if (!(obj instanceof  XmlRequestReader)) {
137:                    return false;
138:                }
139:
140:                XmlRequestReader other = (XmlRequestReader) obj;
141:
142:                return new EqualsBuilder().append(element, other.element)
143:                        .append(version, other.version).append(serviceId,
144:                                other.serviceId).isEquals();
145:            }
146:
147:            /**
148:             * Implementation of hashcode.
149:             */
150:            public int hashCode() {
151:                return new HashCodeBuilder().append(element).append(version)
152:                        .append(serviceId).toHashCode();
153:            }
154:
155:            public String getServiceId() {
156:                return serviceId;
157:            }
158:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.