Source Code Cross Referenced for ValidationException.java in  » XML » XPath-Saxon » net » sf » saxon » type » 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 » XML » XPath Saxon » net.sf.saxon.type 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sf.saxon.type;
002:
003:        import net.sf.saxon.trans.XPathException;
004:        import org.xml.sax.Locator;
005:
006:        import javax.xml.transform.SourceLocator;
007:
008:        /**
009:         * This exception indicates a failure when validating an instance against a type
010:         * defined in a schema.
011:         */
012:
013:        public class ValidationException extends XPathException implements 
014:                SourceLocator, Locator {
015:
016:            private String systemId;
017:            private String publicId;
018:            private int lineNumber = -1;
019:            private int columnNumber = -1;
020:
021:            /**
022:             * Creates a new ValidationException with the given message.
023:             * @param message the message for this Exception
024:             **/
025:            public ValidationException(String message) {
026:                super (message);
027:            }
028:
029:            /**
030:             * Creates a new ValidationException with the given nested
031:             * exception.
032:             * @param exception the nested exception
033:             **/
034:            public ValidationException(Exception exception) {
035:                super (exception);
036:            }
037:
038:            /**
039:             * Creates a new ValidationException with the given message
040:             * and nested exception.
041:             * @param message the detail message for this exception
042:             * @param exception the nested exception
043:             **/
044:            public ValidationException(String message, Exception exception) {
045:                super (message, exception);
046:            }
047:
048:            /**
049:             * Create a new XPathException from a message and a Locator.
050:             * @param message The error or warning message.
051:             * @param locator The locator object for the error or warning.
052:             */
053:            public ValidationException(String message, SourceLocator locator) {
054:                super (message, locator);
055:                // With Xerces, it's enough to store the locator as part of the exception. But with Crimson,
056:                // the locator is destroyed when the parse terminates, which means the location information
057:                // will not be available in the final error message. So we copy the location information now,
058:                // as part of the exception object itself.
059:                setSourceLocator(locator);
060:            }
061:
062:            /**
063:             * Returns the String representation of this Exception
064:             * @return the String representation of this Exception
065:             **/
066:            public String toString() {
067:                StringBuffer sb = new StringBuffer("ValidationException: ");
068:                String message = getMessage();
069:                if (message != null)
070:                    sb.append(message);
071:                return sb.toString();
072:            }
073:
074:            public String getPublicId() {
075:                if (publicId == null && getLocator() != this ) {
076:                    return getLocator().getPublicId();
077:                } else {
078:                    return publicId;
079:                }
080:            }
081:
082:            public String getSystemId() {
083:                if (systemId == null && getLocator() != this ) {
084:                    return getLocator().getSystemId();
085:                } else {
086:                    return systemId;
087:                }
088:            }
089:
090:            public int getLineNumber() {
091:                if (lineNumber == -1 && getLocator() != this ) {
092:                    return getLocator().getLineNumber();
093:                } else {
094:                    return lineNumber;
095:                }
096:            }
097:
098:            public int getColumnNumber() {
099:                if (columnNumber == -1 && getLocator() != this ) {
100:                    return getLocator().getColumnNumber();
101:                } else {
102:                    return columnNumber;
103:                }
104:            }
105:
106:            public void setPublicId(String id) {
107:                publicId = id;
108:            }
109:
110:            public void setSystemId(String id) {
111:                systemId = id;
112:            }
113:
114:            public void setLineNumber(int line) {
115:                lineNumber = line;
116:            }
117:
118:            public void setColumnNumber(int column) {
119:                columnNumber = column;
120:            }
121:
122:            public void setLocator(Locator locator) {
123:                setPublicId(locator.getPublicId());
124:                setSystemId(locator.getSystemId());
125:                setLineNumber(locator.getLineNumber());
126:                setColumnNumber(locator.getColumnNumber());
127:                super .setLocator(null);
128:            }
129:
130:            public void setSourceLocator(SourceLocator locator) {
131:                setPublicId(locator.getPublicId());
132:                setSystemId(locator.getSystemId());
133:                setLineNumber(locator.getLineNumber());
134:                setColumnNumber(locator.getColumnNumber());
135:                super .setLocator(null);
136:            }
137:
138:            public SourceLocator getLocator() {
139:                SourceLocator loc = super .getLocator();
140:                if (loc != null) {
141:                    return loc;
142:                } else {
143:                    return this ;
144:                }
145:            }
146:
147:        }
148:
149:        //
150:        // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
151:        // you may not use this file except in compliance with the License. You may obtain a copy of the
152:        // License at http://www.mozilla.org/MPL/
153:        //
154:        // Software distributed under the License is distributed on an "AS IS" basis,
155:        // WITHOUT WARRANTY OF ANY KIND, either express or implied.
156:        // See the License for the specific language governing rights and limitations under the License.
157:        //
158:        // The Original Code is: all this file.
159:        //
160:        // The Initial Developer of the Original Code is Saxonica Limited
161:        //
162:        // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
163:        //
164:        // Contributor(s): none
165:        //
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.