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


001:        package com.rimfaxe.xml.xmlreader;
002:
003:        /** Thrown when error parsing XML or XPath.
004:
005:         <blockquote><small> Copyright (C) 2002 Hewlett-Packard Company.
006:         This file is part of Sparta, an XML Parser, DOM, and XPath library.
007:         This library is free software; you can redistribute it and/or
008:         modify it under the terms of the GNU Lesser General Public License
009:         as published by the Free Software Foundation; either version 2.1 of
010:         the License, or (at your option) any later version.  This library
011:         is distributed in the hope that it will be useful, but WITHOUT ANY
012:         WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         FITNESS FOR A PARTICULAR PURPOSE.</small></blockquote>
014:         @see <a "href="doc-files/LGPL.txt">GNU Lesser General Public License</a>
015:         @version  $Date: 2002/08/19 05:03:58 $  $Revision: 1.1.1.1 $
016:         @author Eamonn O'Brien-Strain
017:         */
018:        public class ParseException extends Exception {
019:
020:            public ParseException(String msg) {
021:                super (msg);
022:            }
023:
024:            /* For use by handlers */
025:            public ParseException(String msg, Throwable cause) {
026:                super (msg + " " + cause);
027:                this .cause_ = cause;
028:            }
029:
030:            /* Using systemID */
031:            public ParseException(String systemId, int lineNumber,
032:                    int lastCharRead, String history, String msg) {
033:                super (toMessage(systemId, lineNumber, lastCharRead, history,
034:                        msg));
035:                lineNumber_ = lineNumber;
036:            }
037:
038:            public ParseException(ParseLog log, String systemId,
039:                    int lineNumber, int lastCharRead, String history, String msg) {
040:                this (systemId, lineNumber, lastCharRead, history, msg);
041:                log.error(msg, systemId, lineNumber);
042:            }
043:
044:            public ParseException(ParseCharStream source, String msg) {
045:                this (source.getLog(), source.getSystemId(), source
046:                        .getLineNumber(), source.getLastCharRead(), source
047:                        .getHistory(), msg);
048:            }
049:
050:            public ParseException(ParseCharStream source, char actual,
051:                    char expected) {
052:                this (source, "got \'" + actual + "\' instead of expected \'"
053:                        + expected + "\'");
054:            }
055:
056:            /** Precondition: expected.length > 0 */
057:            public ParseException(ParseCharStream source, char actual,
058:                    char[] expected) {
059:                this (source, "got \'" + actual + "\' instead of "
060:                        + toString(expected));
061:            }
062:
063:            public ParseException(ParseCharStream source, char actual,
064:                    String expected) {
065:                this (source, "got \'" + actual + "\' instead of " + expected
066:                        + " as expected");
067:            }
068:
069:            public ParseException(ParseCharStream source, String actual,
070:                    String expected) {
071:                this (source, "got \"" + actual + "\" instead of \"" + expected
072:                        + "\" as expected");
073:            }
074:
075:            static private String toString(char[] chars) {
076:                StringBuffer result = new StringBuffer();
077:                result.append(chars[0]);
078:                for (int i = 1; i < chars.length; ++i)
079:                    result.append("or " + chars[i]);
080:                return result.toString();
081:            }
082:
083:            public ParseException(ParseCharStream source, String actual,
084:                    char[] expected) {
085:                this (source, actual, new String(expected));
086:            }
087:
088:            public int getLineNumber() {
089:                return lineNumber_;
090:            }
091:
092:            private int lineNumber_ = -1;
093:
094:            public Throwable getCause() {
095:                return cause_;
096:            }
097:
098:            //////////////////////////////////////////////////////////////////
099:
100:            /*static private String toMessage(ParseCharStream source, String msg){
101:              return toMessage( source.getSystemId(),
102:              source.getLineNumber(),
103:              source.getLastCharRead(),
104:              source.getHistory(),
105:              msg );
106:              }*/
107:
108:            static private String toMessage(String systemId, int lineNumber,
109:                    int lastCharRead, String history, String msg) {
110:                return systemId + "(" + lineNumber + "): \n" + history
111:                        + "\nLast character read was \'"
112:                        + charRepr(lastCharRead) + "\'\n" + msg;
113:            }
114:
115:            static String charRepr(int ch) {
116:                return (ch == -1) ? "EOF" : ("" + (char) ch);
117:            }
118:
119:            private Throwable cause_ = null;
120:
121:        }
122:
123:        // $Log: ParseException.java,v $
124:        // Revision 1.1.1.1  2002/08/19 05:03:58  eobrain
125:        // import from HP Labs internal CVS
126:        //
127:        // Revision 1.13  2002/08/18 04:37:56  eob
128:        // Add copyright and other formatting and commenting in preparation for
129:        // release to SourceForge.
130:        //
131:        // Revision 1.12  2002/08/09 22:36:49  sermarti
132:        //
133:        // Revision 1.11  2002/08/05 20:04:32  sermarti
134:        //
135:        // Revision 1.10  2002/07/25 21:10:15  sermarti
136:        // Adding files that mysteriously weren't added from Sparta before.
137:        //
138:        // Revision 1.9  2002/05/23 21:29:32  eob
139:        // Tweaks.
140:        //
141:        // Revision 1.8  2002/05/09 20:58:30  eob
142:        // Add protected constructor to allow sub-classes without supplying all
143:        // other info.
144:        //
145:        // Revision 1.7  2002/05/09 16:50:21  eob
146:        // Add history for better error reporting.
147:        //
148:        // Revision 1.6  2002/01/08 19:51:02  eob
149:        // Factored out constructors for more flexibilty.
150:        //
151:        // Revision 1.5  2002/01/04 00:38:40  eob
152:        // Improve logging.
153:        //
154:        // Revision 1.4  2002/01/04 16:52:40  eob
155:        // Comment change only.
156:        //
157:        // Revision 1.3  2002/01/04 16:52:10  eob
158:        // Add constructors.
159:        //
160:        // Revision 1.2  2001/12/20 20:07:49  eob
161:        // Added constructor that takes 2 strings.  Add getLineNumber method.
162:        //
163:        // Revision 1.1  2001/12/19 05:52:38  eob
164:        // initial
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.