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


001:        // SAX exception class.
002:        // No warranty; no copyright -- use this as you will.
003:        // $Id: SAXParseException.java,v 1.2 2005/03/25 14:58:33 csilva Exp $
004:
005:        package org.xml.sax;
006:
007:        /**
008:         * Encapsulate an XML parse error or warning.
009:         *
010:         * <p>This exception will include information for locating the error
011:         * in the original XML document.  Note that although the application
012:         * will receive a SAXParseException as the argument to the handlers
013:         * in the ErrorHandler interface, the application is not actually
014:         * required to throw the exception; instead, it can simply read the
015:         * information in it and take a different action.</p>
016:         *
017:         * <p>Since this exception is a subclass of SAXException, it
018:         * inherits the ability to wrap another exception.</p>
019:         *
020:         * @author David Megginson (ak117@freenet.carleton.ca)
021:         * @version 1.0
022:         * @see org.xml.sax.SAXException
023:         * @see org.xml.sax.Locator
024:         * @see org.xml.sax.ErrorHandler
025:         */
026:        public class SAXParseException extends SAXException {
027:            private static final long serialVersionUID = 3257569507558897205L;
028:
029:            //////////////////////////////////////////////////////////////////////
030:            // Constructors.
031:            //////////////////////////////////////////////////////////////////////
032:
033:            /**
034:             * Create a new SAXParseException from a message and a Locator.
035:             *
036:             * <p>This constructor is especially useful when an application is
037:             * creating its own exception from within a DocumentHandler
038:             * callback.</p>
039:             *
040:             * @param message The error or warning message.
041:             * @param locator The locator object for the error or warning.
042:             * @see org.xml.sax.Locator
043:             * @see org.xml.sax.Parser#setLocale 
044:             */
045:            public SAXParseException(String message, Locator locator) {
046:                super (message);
047:                this .publicId = locator.getPublicId();
048:                this .systemId = locator.getSystemId();
049:                this .lineNumber = locator.getLineNumber();
050:                this .columnNumber = locator.getColumnNumber();
051:            }
052:
053:            /**
054:             * Wrap an existing exception in a SAXParseException.
055:             *
056:             * <p>This constructor is especially useful when an application is
057:             * creating its own exception from within a DocumentHandler
058:             * callback, and needs to wrap an existing exception that is not a
059:             * subclass of SAXException.</p>
060:             *
061:             * @param message The error or warning message, or null to
062:             *                use the message from the embedded exception.
063:             * @param locator The locator object for the error or warning.
064:             * @param e Any exception
065:             * @see org.xml.sax.Locator
066:             * @see org.xml.sax.Parser#setLocale
067:             */
068:            public SAXParseException(String message, Locator locator,
069:                    Exception e) {
070:                super (message, e);
071:                this .publicId = locator.getPublicId();
072:                this .systemId = locator.getSystemId();
073:                this .lineNumber = locator.getLineNumber();
074:                this .columnNumber = locator.getColumnNumber();
075:            }
076:
077:            /**
078:             * Create a new SAXParseException.
079:             *
080:             * <p>This constructor is most useful for parser writers.</p>
081:             *
082:             * <p>If the system identifier is a URL, the parser must resolve it
083:             * fully before creating the exception.</p>
084:             *
085:             * @param message The error or warning message.
086:             * @param publicId The public identifer of the entity that generated
087:             *                 the error or warning.
088:             * @param systemId The system identifer of the entity that generated
089:             *                 the error or warning.
090:             * @param lineNumber The line number of the end of the text that
091:             *                   caused the error or warning.
092:             * @param columnNumber The column number of the end of the text that
093:             *                     cause the error or warning.
094:             * @see org.xml.sax.Parser#setLocale
095:             */
096:            public SAXParseException(String message, String publicId,
097:                    String systemId, int lineNumber, int columnNumber) {
098:                super (message);
099:                this .publicId = publicId;
100:                this .systemId = systemId;
101:                this .lineNumber = lineNumber;
102:                this .columnNumber = columnNumber;
103:            }
104:
105:            /**
106:             * Create a new SAXParseException with an embedded exception.
107:             *
108:             * <p>This constructor is most useful for parser writers who
109:             * need to wrap an exception that is not a subclass of
110:             * SAXException.</p>
111:             *
112:             * <p>If the system identifier is a URL, the parser must resolve it
113:             * fully before creating the exception.</p>
114:             *
115:             * @param message The error or warning message, or null to use
116:             *                the message from the embedded exception.
117:             * @param publicId The public identifer of the entity that generated
118:             *                 the error or warning.
119:             * @param systemId The system identifer of the entity that generated
120:             *                 the error or warning.
121:             * @param lineNumber The line number of the end of the text that
122:             *                   caused the error or warning.
123:             * @param columnNumber The column number of the end of the text that
124:             *                     cause the error or warning.
125:             * @param e Another exception to embed in this one.
126:             * @see org.xml.sax.Parser#setLocale
127:             */
128:            public SAXParseException(String message, String publicId,
129:                    String systemId, int lineNumber, int columnNumber,
130:                    Exception e) {
131:                super (message, e);
132:                this .publicId = publicId;
133:                this .systemId = systemId;
134:                this .lineNumber = lineNumber;
135:                this .columnNumber = columnNumber;
136:            }
137:
138:            /**
139:             * Get the public identifier of the entity where the exception occurred.
140:             *
141:             * @return A string containing the public identifier, or null
142:             *         if none is available.
143:             * @see org.xml.sax.Locator#getPublicId
144:             */
145:            public String getPublicId() {
146:                return this .publicId;
147:            }
148:
149:            /**
150:             * Get the system identifier of the entity where the exception occurred.
151:             *
152:             * <p>If the system identifier is a URL, it will be resolved
153:             * fully.</p>
154:             *
155:             * @return A string containing the system identifier, or null
156:             *         if none is available.
157:             * @see org.xml.sax.Locator#getSystemId
158:             */
159:            public String getSystemId() {
160:                return this .systemId;
161:            }
162:
163:            /**
164:             * The line number of the end of the text where the exception occurred.
165:             *
166:             * @return An integer representing the line number, or -1
167:             *         if none is available.
168:             * @see org.xml.sax.Locator#getLineNumber
169:             */
170:            public int getLineNumber() {
171:                return this .lineNumber;
172:            }
173:
174:            /**
175:             * The column number of the end of the text where the exception occurred.
176:             *
177:             * <p>The first column in a line is position 1.</p>
178:             *
179:             * @return An integer representing the column number, or -1
180:             *         if none is available.
181:             * @see org.xml.sax.Locator#getColumnNumber
182:             */
183:            public int getColumnNumber() {
184:                return this .columnNumber;
185:            }
186:
187:            //////////////////////////////////////////////////////////////////////
188:            // Internal state.
189:            //////////////////////////////////////////////////////////////////////
190:
191:            private String publicId;
192:            private String systemId;
193:            private int lineNumber;
194:            private int columnNumber;
195:
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.