Source Code Cross Referenced for WFSSchemaFactory.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » wfs » 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 » GeoTools 2.4.1 » org.geotools.data.wfs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2004-2006, Geotools Project Managment Committee (PMC)
005:         *
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation; either
009:         *    version 2.1 of the License, or (at your option) any later version.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.data.wfs;
017:
018:        import java.net.URI;
019:
020:        import org.geotools.ows.ServiceException;
021:        import org.geotools.xml.SchemaFactory;
022:        import org.geotools.xml.XSIElementHandler;
023:        import org.geotools.xml.XSISAXHandler;
024:        import org.geotools.xml.filter.FilterSchema;
025:        import org.geotools.xml.handlers.xsi.RootHandler;
026:        import org.geotools.xml.schema.Schema;
027:        import org.xml.sax.Attributes;
028:        import org.xml.sax.SAXException;
029:
030:        /**
031:         * <p>
032:         * DOCUMENT ME!
033:         * </p>
034:         *
035:         * @author dzwiers
036:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/plugin/wfs/src/main/java/org/geotools/data/wfs/WFSSchemaFactory.java $
037:         */
038:        public class WFSSchemaFactory extends SchemaFactory {
039:            // HACK for setting up the static field to use.
040:            protected WFSSchemaFactory() {
041:                is = this ;
042:            }
043:
044:            protected XSISAXHandler getSAXHandler(URI uri) {
045:                return new WFSXSISAXHandler(uri);
046:            }
047:
048:            protected static class WFSXSISAXHandler extends XSISAXHandler {
049:                /**
050:                 * 
051:                 * @param uri
052:                 */
053:                public WFSXSISAXHandler(URI uri) {
054:                    super (uri);
055:                    rootHandler = new WFSRootHandler(uri);
056:                }
057:            }
058:
059:            protected static class WFSRootHandler extends RootHandler {
060:                /**
061:                 * Comment for <code>serialVersionUID</code>
062:                 */
063:                private static final long serialVersionUID = "org.geotools.data.wfs.WFSSchemaFactory.WFSRootHandler"
064:                        .hashCode();
065:                private ServiceExceptionReportHandler se = null;
066:
067:                /**
068:                 * 
069:                 * @param uri
070:                 */
071:                public WFSRootHandler(URI uri) {
072:                    super (uri);
073:                }
074:
075:                /**
076:                 * 
077:                 * @see org.geotools.xml.XSIElementHandler#getHandler(java.lang.String, java.lang.String)
078:                 */
079:                public XSIElementHandler getHandler(String namespaceURI,
080:                        String localName) {
081:                    XSIElementHandler r = null;
082:                    r = super .getHandler(namespaceURI, localName);
083:
084:                    if (r != null) {
085:                        return r;
086:                    }
087:
088:                    if ("ServiceExceptionReport".equalsIgnoreCase(localName)
089:                            && FilterSchema.NAMESPACE.toString()
090:                                    .equalsIgnoreCase(namespaceURI)) {
091:                        //                FilterSchema.getInstance().getElements()[37]
092:                        //                ServiceException
093:                        if (se == null) {
094:                            se = new ServiceExceptionReportHandler();
095:                        }
096:
097:                        return se;
098:                    }
099:
100:                    return null;
101:                }
102:
103:                /**
104:                 * 
105:                 * @see org.geotools.xml.handlers.xsi.RootHandler#getSchema()
106:                 */
107:                public Schema getSchema() throws SAXException {
108:                    if (se != null) {
109:                        if (se.getException() != null) {
110:                            throw se.getException();
111:                        }
112:                    }
113:
114:                    return super .getSchema();
115:                }
116:            }
117:
118:            private static class ServiceExceptionReportHandler extends
119:                    XSIElementHandler {
120:                /**
121:                 * Comment for <code>serialVersionUID</code>
122:                 */
123:                private static final long serialVersionUID = "org.geotools.data.wfs.WFSSchemaFactory.ServiceExceptionReportHandler"
124:                        .hashCode();
125:                private ServiceException exception;
126:                private boolean inside = false;
127:
128:                /**
129:                 * @see org.geotools.xml.XSIElementHandler#getHandlerType()
130:                 */
131:                public int getHandlerType() {
132:                    return DEFAULT;
133:                }
134:
135:                protected ServiceException getException() {
136:                    return exception;
137:                }
138:
139:                /**
140:                 * @see org.geotools.xml.XSIElementHandler#endElement(java.lang.String,
141:                 *      java.lang.String)
142:                 */
143:                public void endElement(String namespaceURI, String localName) {
144:                    inside = false;
145:                }
146:
147:                /**
148:                 * @see org.geotools.xml.XSIElementHandler#startElement(java.lang.String,
149:                 *      java.lang.String, org.xml.sax.Attributes)
150:                 */
151:                public void startElement(String namespaceURI, String localName,
152:                        Attributes attr) {
153:                    if ("ServiceException".equalsIgnoreCase(localName)) {
154:                        inside = true;
155:
156:                        if (attr != null) {
157:                            String locator = attr.getValue("", "locator");
158:
159:                            if (locator == null) {
160:                                locator = attr
161:                                        .getValue(namespaceURI, "locator");
162:                            }
163:
164:                            String code = attr.getValue("", "code");
165:
166:                            if (code == null) {
167:                                code = attr.getValue(namespaceURI, "code");
168:                            }
169:
170:                            exception = new ServiceException("", code, locator);
171:                        }
172:                    }
173:                }
174:
175:                /**
176:                 * @see org.geotools.xml.XSIElementHandler#characters(java.lang.String)
177:                 */
178:                public void characters(String text) {
179:                    if (inside) {
180:                        exception = new ServiceException(text, exception
181:                                .getCode(), exception.getLocator());
182:                    }
183:                }
184:
185:                /**
186:                 * @see org.geotools.xml.XSIElementHandler#getHandler(java.lang.String,
187:                 *      java.lang.String)
188:                 */
189:                public XSIElementHandler getHandler(String namespaceURI,
190:                        String localName) {
191:                    if ("ServiceException".equalsIgnoreCase(localName)
192:                            && FilterSchema.NAMESPACE.toString()
193:                                    .equalsIgnoreCase(namespaceURI)) {
194:                        return this ;
195:                    }
196:
197:                    return null;
198:                }
199:
200:                /**
201:                 * @see org.geotools.xml.XSIElementHandler#getLocalName()
202:                 */
203:                public String getLocalName() {
204:                    // TODO Auto-generated method stub
205:                    return null;
206:                }
207:
208:                /**
209:                 * @see org.geotools.xml.XSIElementHandler#hashCode()
210:                 */
211:                public int hashCode() {
212:                    // TODO Auto-generated method stub
213:                    return 0;
214:                }
215:            }
216:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.