Source Code Cross Referenced for SAXParseException.java in  » Web-Server » Rimfaxe-Web-Server » org » xml » sax » 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 » Web Server » Rimfaxe Web Server » org.xml.sax 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // SAX exception class.
002:        // http://www.saxproject.org
003:        // No warranty; no copyright -- use this as you will.
004:        // $Id: SAXParseException.java,v 1.6 2002/02/01 20:06:20 db Exp $
005:
006:        package org.xml.sax;
007:
008:        /**
009:         * Encapsulate an XML parse error or warning.
010:         *
011:         * <blockquote>
012:         * <em>This module, both source code and documentation, is in the
013:         * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
014:         * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
015:         * for further information.
016:         * </blockquote>
017:         *
018:         * <p>This exception may include information for locating the error
019:         * in the original XML document, as if it came from a {@link Locator}
020:         * object.  Note that although the application
021:         * will receive a SAXParseException as the argument to the handlers
022:         * in the {@link org.xml.sax.ErrorHandler ErrorHandler} interface, 
023:         * the application is not actually required to throw the exception; 
024:         * instead, it can simply read the information in it and take a 
025:         * different action.</p>
026:         *
027:         * <p>Since this exception is a subclass of {@link org.xml.sax.SAXException 
028:         * SAXException}, it inherits the ability to wrap another exception.</p>
029:         *
030:         * @since SAX 1.0
031:         * @author David Megginson
032:         * @version 2.0.1 (sax2r2)
033:         * @see org.xml.sax.SAXException
034:         * @see org.xml.sax.Locator
035:         * @see org.xml.sax.ErrorHandler
036:         */
037:        public class SAXParseException extends SAXException {
038:
039:            //////////////////////////////////////////////////////////////////////
040:            // Constructors.
041:            //////////////////////////////////////////////////////////////////////
042:
043:            /**
044:             * Create a new SAXParseException from a message and a Locator.
045:             *
046:             * <p>This constructor is especially useful when an application is
047:             * creating its own exception from within a {@link org.xml.sax.ContentHandler
048:             * ContentHandler} callback.</p>
049:             *
050:             * @param message The error or warning message.
051:             * @param locator The locator object for the error or warning (may be
052:             *        null).
053:             * @see org.xml.sax.Locator
054:             */
055:            public SAXParseException(String message, Locator locator) {
056:                super (message);
057:                if (locator != null) {
058:                    init(locator.getPublicId(), locator.getSystemId(), locator
059:                            .getLineNumber(), locator.getColumnNumber());
060:                } else {
061:                    init(null, null, -1, -1);
062:                }
063:            }
064:
065:            /**
066:             * Wrap an existing exception in a SAXParseException.
067:             *
068:             * <p>This constructor is especially useful when an application is
069:             * creating its own exception from within a {@link org.xml.sax.ContentHandler
070:             * ContentHandler} callback, and needs to wrap an existing exception that is not a
071:             * subclass of {@link org.xml.sax.SAXException SAXException}.</p>
072:             *
073:             * @param message The error or warning message, or null to
074:             *                use the message from the embedded exception.
075:             * @param locator The locator object for the error or warning (may be
076:             *        null).
077:             * @param e Any exception.
078:             * @see org.xml.sax.Locator
079:             */
080:            public SAXParseException(String message, Locator locator,
081:                    Exception e) {
082:                super (message, e);
083:                if (locator != null) {
084:                    init(locator.getPublicId(), locator.getSystemId(), locator
085:                            .getLineNumber(), locator.getColumnNumber());
086:                } else {
087:                    init(null, null, -1, -1);
088:                }
089:            }
090:
091:            /**
092:             * Create a new SAXParseException.
093:             *
094:             * <p>This constructor is most useful for parser writers.</p>
095:             *
096:             * <p>All parameters except the message are as if
097:             * they were provided by a {@link Locator}.  For example, if the
098:             * system identifier is a URL (including relative filename), the
099:             * caller must resolve it fully before creating the exception.</p>
100:             *
101:             *
102:             * @param message The error or warning message.
103:             * @param publicId The public identifer of the entity that generated
104:             *                 the error or warning.
105:             * @param systemId The system identifer of the entity that generated
106:             *                 the error or warning.
107:             * @param lineNumber The line number of the end of the text that
108:             *                   caused the error or warning.
109:             * @param columnNumber The column number of the end of the text that
110:             *                     cause the error or warning.
111:             */
112:            public SAXParseException(String message, String publicId,
113:                    String systemId, int lineNumber, int columnNumber) {
114:                super (message);
115:                init(publicId, systemId, lineNumber, columnNumber);
116:            }
117:
118:            /**
119:             * Create a new SAXParseException with an embedded exception.
120:             *
121:             * <p>This constructor is most useful for parser writers who
122:             * need to wrap an exception that is not a subclass of
123:             * {@link org.xml.sax.SAXException SAXException}.</p>
124:             *
125:             * <p>All parameters except the message and exception are as if
126:             * they were provided by a {@link Locator}.  For example, if the
127:             * system identifier is a URL (including relative filename), the
128:             * caller must resolve it fully before creating the exception.</p>
129:             *
130:             * @param message The error or warning message, or null to use
131:             *                the message from the embedded exception.
132:             * @param publicId The public identifer of the entity that generated
133:             *                 the error or warning.
134:             * @param systemId The system identifer of the entity that generated
135:             *                 the error or warning.
136:             * @param lineNumber The line number of the end of the text that
137:             *                   caused the error or warning.
138:             * @param columnNumber The column number of the end of the text that
139:             *                     cause the error or warning.
140:             * @param e Another exception to embed in this one.
141:             */
142:            public SAXParseException(String message, String publicId,
143:                    String systemId, int lineNumber, int columnNumber,
144:                    Exception e) {
145:                super (message, e);
146:                init(publicId, systemId, lineNumber, columnNumber);
147:            }
148:
149:            /**
150:             * Internal initialization method.
151:             *
152:             * @param publicId The public identifier of the entity which generated the exception,
153:             *        or null.
154:             * @param systemId The system identifier of the entity which generated the exception,
155:             *        or null.
156:             * @param lineNumber The line number of the error, or -1.
157:             * @param columnNumber The column number of the error, or -1.
158:             */
159:            private void init(String publicId, String systemId, int lineNumber,
160:                    int columnNumber) {
161:                this .publicId = publicId;
162:                this .systemId = systemId;
163:                this .lineNumber = lineNumber;
164:                this .columnNumber = columnNumber;
165:            }
166:
167:            /**
168:             * Get the public identifier of the entity where the exception occurred.
169:             *
170:             * @return A string containing the public identifier, or null
171:             *         if none is available.
172:             * @see org.xml.sax.Locator#getPublicId
173:             */
174:            public String getPublicId() {
175:                return this .publicId;
176:            }
177:
178:            /**
179:             * Get the system identifier of the entity where the exception occurred.
180:             *
181:             * <p>If the system identifier is a URL, it will have been resolved
182:             * fully.</p>
183:             *
184:             * @return A string containing the system identifier, or null
185:             *         if none is available.
186:             * @see org.xml.sax.Locator#getSystemId
187:             */
188:            public String getSystemId() {
189:                return this .systemId;
190:            }
191:
192:            /**
193:             * The line number of the end of the text where the exception occurred.
194:             *
195:             * <p>The first line is line 1.</p>
196:             *
197:             * @return An integer representing the line number, or -1
198:             *         if none is available.
199:             * @see org.xml.sax.Locator#getLineNumber
200:             */
201:            public int getLineNumber() {
202:                return this .lineNumber;
203:            }
204:
205:            /**
206:             * The column number of the end of the text where the exception occurred.
207:             *
208:             * <p>The first column in a line is position 1.</p>
209:             *
210:             * @return An integer representing the column number, or -1
211:             *         if none is available.
212:             * @see org.xml.sax.Locator#getColumnNumber
213:             */
214:            public int getColumnNumber() {
215:                return this .columnNumber;
216:            }
217:
218:            //////////////////////////////////////////////////////////////////////
219:            // Internal state.
220:            //////////////////////////////////////////////////////////////////////
221:
222:            /**
223:             * @serial The public identifier, or null.
224:             * @see #getPublicId
225:             */
226:            private String publicId;
227:
228:            /**
229:             * @serial The system identifier, or null.
230:             * @see #getSystemId
231:             */
232:            private String systemId;
233:
234:            /**
235:             * @serial The line number, or -1.
236:             * @see #getLineNumber
237:             */
238:            private int lineNumber;
239:
240:            /**
241:             * @serial The column number, or -1.
242:             * @see #getColumnNumber
243:             */
244:            private int columnNumber;
245:
246:        }
247:
248:        // end of SAXParseException.java
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.