Source Code Cross Referenced for XMLValidationException.java in  » XML-UI » XUI » net » n3 » nanoxml » 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 UI » XUI » net.n3.nanoxml 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* XMLValidationException.java                                     NanoXML/Java
002:         *
003:         * $Revision: 1.17 $
004:         * $Date: 2005/01/05 17:20:04 $
005:         * $Name:  $
006:         *
007:         * This file is part of NanoXML 2 for Java.
008:         * Copyright (C) 2000-2002 Marc De Scheemaecker, All Rights Reserved.
009:         *
010:         * This software is provided 'as-is', without any express or implied warranty.
011:         * In no event will the authors be held liable for any damages arising from the
012:         * use of this software.
013:         *
014:         * Permission is granted to anyone to use this software for any purpose,
015:         * including commercial applications, and to alter it and redistribute it
016:         * freely, subject to the following restrictions:
017:         *
018:         *  1. The origin of this software must not be misrepresented; you must not
019:         *     claim that you wrote the original software. If you use this software in
020:         *     a product, an acknowledgment in the product documentation would be
021:         *     appreciated but is not required.
022:         *
023:         *  2. Altered source versions must be plainly marked as such, and must not be
024:         *     misrepresented as being the original software.
025:         *
026:         *  3. This notice may not be removed or altered from any source distribution.
027:         */
028:
029:        package net.n3.nanoxml;
030:
031:        /**
032:         * An XMLValidationException is thrown when the XML passed to the XML parser is
033:         * well-formed but not valid.
034:         *
035:         * @author Marc De Scheemaecker
036:         * @version $Name:  $, $Revision: 1.17 $
037:         */
038:        public class XMLValidationException extends XMLException {
039:
040:            /**
041:             * An element was missing.
042:             */
043:            public static final int MISSING_ELEMENT = 1;
044:
045:            /**
046:             * An unexpected element was encountered.
047:             */
048:            public static final int UNEXPECTED_ELEMENT = 2;
049:
050:            /**
051:             * An attribute was missing.
052:             */
053:            public static final int MISSING_ATTRIBUTE = 3;
054:
055:            /**
056:             * An unexpected attribute was encountered.
057:             */
058:            public static final int UNEXPECTED_ATTRIBUTE = 4;
059:
060:            /**
061:             * An attribute has an invalid value.
062:             */
063:            public static final int ATTRIBUTE_WITH_INVALID_VALUE = 5;
064:
065:            /**
066:             * A PCDATA element was missing.
067:             */
068:            public static final int MISSING_PCDATA = 6;
069:
070:            /**
071:             * An unexpected PCDATA element was encountered.
072:             */
073:            public static final int UNEXPECTED_PCDATA = 7;
074:
075:            /**
076:             * Another error than those specified in this class was encountered.
077:             */
078:            public static final int MISC_ERROR = 0;
079:
080:            /**
081:             * Which error occurred.
082:             */
083:            private int errorType;
084:
085:            /**
086:             * The name of the element where the exception occurred.
087:             */
088:            private String elementName;
089:
090:            /**
091:             * The name of the attribute where the exception occurred.
092:             */
093:            private String attributeName;
094:
095:            /**
096:             * The value of the attribute where the exception occurred.
097:             */
098:            private String attributeValue;
099:
100:            /**
101:             * Creates a new exception.
102:             *
103:             * @param errorType      the type of validity error
104:             * @param systemID       the system ID from where the data came
105:             * @param lineNr         the line number in the XML data where the
106:             *                       exception occurred.
107:             * @param elementName    the name of the offending element
108:             * @param attributeName  the name of the offending attribute
109:             * @param attributeValue the value of the offending attribute
110:             * @param msg            the message of the exception.
111:             */
112:            public XMLValidationException(int errorType, String systemID,
113:                    int lineNr, String elementName, String attributeName,
114:                    String attributeValue, String msg) {
115:                super (systemID, lineNr, null, msg
116:                        + ((elementName == null) ? ""
117:                                : (", element=" + elementName))
118:                        + ((attributeName == null) ? ""
119:                                : (", attribute=" + attributeName))
120:                        + ((attributeValue == null) ? "" : (", value='"
121:                                + attributeValue + "'")), false);
122:                this .elementName = elementName;
123:                this .attributeName = attributeName;
124:                this .attributeValue = attributeValue;
125:            }
126:
127:            /**
128:             * Cleans up the object when it's destroyed.
129:             */
130:            protected void finalize() throws Throwable {
131:                this .elementName = null;
132:                this .attributeName = null;
133:                this .attributeValue = null;
134:                super .finalize();
135:            }
136:
137:            /**
138:             * Returns the name of the element in which the validation is violated.
139:             * If there is no current element, null is returned.
140:             */
141:            public String getElementName() {
142:                return this .elementName;
143:            }
144:
145:            /**
146:             * Returns the name of the attribute in which the validation is violated.
147:             * If there is no current attribute, null is returned.
148:             */
149:            public String getAttributeName() {
150:                return this .attributeName;
151:            }
152:
153:            /**
154:             * Returns the value of the attribute in which the validation is violated.
155:             * If there is no current attribute, null is returned.
156:             */
157:            public String getAttributeValue() {
158:                return this.attributeValue;
159:            }
160:
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.