Source Code Cross Referenced for ARPHandlers.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » rdf » arp » 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 » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.rdf.arp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003:         * [See end of file]
004:         */
005:
006:        package com.hp.hpl.jena.rdf.arp;
007:
008:        import org.xml.sax.ErrorHandler;
009:
010:        import com.hp.hpl.jena.rdf.arp.impl.DefaultErrorHandler;
011:        import com.hp.hpl.jena.rdf.arp.impl.XMLHandler;
012:
013:        /**
014:         * The interface to set the various handlers on ARP. User defined
015:         * implementations of this interface are not supported. This is a class rather
016:         * than an interface to have better backward compatibilitiy with earlier
017:         * versions, however constructing instances of this class is deprecated.
018:         * 
019:         * @author Jeremy J. Carroll
020:         * 
021:         */
022:        public class ARPHandlers {
023:
024:            /**
025:             * Do not use this constructor.
026:             * An example of not using this constructor is as follows.
027:             * <br/>
028:             * Deprecated usage:
029:             * <br/>
030:             * <pre>
031:                ARP arp = new ARP();
032:                ARPHandlers handlers = new ARPHandlers();
033:                handlers.setStatementHandler(new MyStatementHandler());
034:             </pre>
035:             <br/>
036:             * Preferred code:
037:             * <br/>
038:             * <pre>
039:                ARP arp = new ARP();
040:                ARPHandlers handlers = arp.getHandlers();
041:                handlers.setStatementHandler(new MyStatementHandler());
042:             </pre>
043:             *@deprecated Use {@link ARPConfig#getHandlers()}
044:             */
045:            public ARPHandlers() {
046:            }
047:
048:            private ErrorHandler errorHandler = new DefaultErrorHandler();
049:
050:            private ExtendedHandler scopeHandler = XMLHandler.nullScopeHandler;
051:
052:            private StatementHandler statementHandler = XMLHandler.nullStatementHandler;
053:
054:            private NamespaceHandler nameHandler = new NamespaceHandler() {
055:
056:                public void startPrefixMapping(String prefix, String uri) {
057:
058:                }
059:
060:                public void endPrefixMapping(String prefix) {
061:
062:                }
063:            };
064:
065:            /**
066:             * Sets the ExtendedHandler that provides the callback mechanism for bnodes
067:             * as they leave scope, and for the start and end of rdf:RDF elements.
068:             * <p>
069:             * See note about large files in {@link ARP} class documentation.
070:             * 
071:             * @param sh
072:             *            The handler to use.
073:             * @return The old handler.
074:             */
075:            public ExtendedHandler setExtendedHandler(ExtendedHandler sh) {
076:                ExtendedHandler old = scopeHandler;
077:                scopeHandler = sh;
078:                return old;
079:            }
080:
081:            /**
082:             * Sets the NamespaceHandler that provides the callback mechanism for XML
083:             * namespace declarations.
084:             * 
085:             * @param sh
086:             *            The handler to use.
087:             * @return The old handler.
088:             */
089:            public NamespaceHandler setNamespaceHandler(NamespaceHandler sh) {
090:                NamespaceHandler old = nameHandler;
091:                nameHandler = sh;
092:                return old;
093:            }
094:
095:            /**
096:             * Sets the StatementHandler that provides the callback mechanism for each
097:             * triple in the file.
098:             * 
099:             * @param sh
100:             *            The statement handler to use.
101:             * @return The old statement handler.
102:             */
103:            public StatementHandler setStatementHandler(StatementHandler sh) {
104:                StatementHandler old = statementHandler;
105:                statementHandler = sh;
106:                return old;
107:            }
108:
109:            /**
110:             * Sets the error handler, for both XML and RDF parse errors. XML errors are
111:             * reported by Xerces, as instances of SAXParseException; the RDF errors are
112:             * reported from ARP as instances of ParseException. Code that needs to
113:             * distingusih between them may look like:
114:             * 
115:             * <pre>
116:             *    void error( SAXParseException e ) throws SAXException {
117:             *      if ( e instanceof com.hp.hpl.jena.rdf.arp.ParseException ) {
118:             *           ...
119:             *      } else {
120:             *           ...
121:             *      }
122:             *    }
123:             * </pre>
124:             * 
125:             * <p>
126:             * See the ARP documentation for ErrorHandler for details of the
127:             * ErrorHandler semantics (in particular how to upgrade a warning to an
128:             * error, and an error to a fatalError).
129:             * </p>
130:             * <p>
131:             * The Xerces/SAX documentation for ErrorHandler is available on the web.
132:             * </p>
133:             * 
134:             * @param eh
135:             *            The error handler to use.
136:             * @return The previous error handler.
137:             */
138:            public ErrorHandler setErrorHandler(ErrorHandler eh) {
139:                ErrorHandler old = errorHandler;
140:                errorHandler = eh;
141:                return old;
142:            }
143:
144:            /**
145:             * Gets the current error handler.
146:             */
147:            public ErrorHandler getErrorHandler() {
148:                return errorHandler;
149:            }
150:
151:            /**
152:             * Gets the current namespace handler.
153:             */
154:            public NamespaceHandler getNamespaceHandler() {
155:                return nameHandler;
156:            }
157:
158:            /**
159:             * Gets the current extended handler.
160:             */
161:            public ExtendedHandler getExtendedHandler() {
162:                return scopeHandler;
163:            }
164:
165:            /**
166:             * Gets the current statement handler.
167:             */
168:            public StatementHandler getStatementHandler() {
169:                return statementHandler;
170:            }
171:
172:        }
173:
174:        /*
175:         * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP All rights
176:         * reserved.
177:         * 
178:         * Redistribution and use in source and binary forms, with or without
179:         * modification, are permitted provided that the following conditions are met:
180:         * 1. Redistributions of source code must retain the above copyright notice,
181:         * this list of conditions and the following disclaimer. 2. Redistributions in
182:         * binary form must reproduce the above copyright notice, this list of
183:         * conditions and the following disclaimer in the documentation and/or other
184:         * materials provided with the distribution. 3. The name of the author may not
185:         * be used to endorse or promote products derived from this software without
186:         * specific prior written permission.
187:         * 
188:         * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
189:         * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
190:         * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
191:         * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
192:         * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
193:         * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
194:         * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
195:         * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
196:         * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
197:         * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
198:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.