Source Code Cross Referenced for TypeConstraintException.java in  » 6.0-JDK-Modules » jaxb-api » javax » xml » bind » 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 » 6.0 JDK Modules » jaxb api » javax.xml.bind 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
003:         * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
004:         */
005:
006:        package javax.xml.bind;
007:
008:        /**
009:         * This exception indicates that a violation of a dynamically checked type 
010:         * constraint was detected.
011:         *
012:         * <p>
013:         * This exception can be thrown by the generated setter methods of the schema
014:         * derived Java content classes.  However, since fail-fast validation is
015:         * an optional feature for JAXB Providers to support, not all setter methods
016:         * will throw this exception when a type constraint is violated.
017:         * 
018:         * <p>
019:         * If this exception is throw while invoking a fail-fast setter, the value of
020:         * the property is guaranteed to remain unchanged, as if the setter were never
021:         * called.
022:         *
023:         * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
024:         * @version $Revision: 1.1 $
025:         * @see ValidationEvent
026:         * @since JAXB1.0
027:         */
028:
029:        public class TypeConstraintException extends java.lang.RuntimeException {
030:
031:            /** 
032:             * Vendor specific error code
033:             *
034:             */
035:            private String errorCode;
036:
037:            /** 
038:             * Exception reference
039:             *
040:             */
041:            private Throwable linkedException;
042:
043:            /** 
044:             * Construct a TypeConstraintException with the specified detail message.  The 
045:             * errorCode and linkedException will default to null.
046:             *
047:             * @param message a description of the exception
048:             */
049:            public TypeConstraintException(String message) {
050:                this (message, null, null);
051:            }
052:
053:            /** 
054:             * Construct a TypeConstraintException with the specified detail message and vendor 
055:             * specific errorCode.  The linkedException will default to null.
056:             *
057:             * @param message a description of the exception
058:             * @param errorCode a string specifying the vendor specific error code
059:             */
060:            public TypeConstraintException(String message, String errorCode) {
061:                this (message, errorCode, null);
062:            }
063:
064:            /** 
065:             * Construct a TypeConstraintException with a linkedException.  The detail message and
066:             * vendor specific errorCode will default to null.
067:             *
068:             * @param exception the linked exception
069:             */
070:            public TypeConstraintException(Throwable exception) {
071:                this (null, null, exception);
072:            }
073:
074:            /** 
075:             * Construct a TypeConstraintException with the specified detail message and 
076:             * linkedException.  The errorCode will default to null.
077:             *
078:             * @param message a description of the exception
079:             * @param exception the linked exception
080:             */
081:            public TypeConstraintException(String message, Throwable exception) {
082:                this (message, null, exception);
083:            }
084:
085:            /** 
086:             * Construct a TypeConstraintException with the specified detail message,
087:             * vendor specific errorCode, and linkedException.
088:             *
089:             * @param message a description of the exception
090:             * @param errorCode a string specifying the vendor specific error code
091:             * @param exception the linked exception
092:             */
093:            public TypeConstraintException(String message, String errorCode,
094:                    Throwable exception) {
095:                super (message);
096:                this .errorCode = errorCode;
097:                this .linkedException = exception;
098:            }
099:
100:            /** 
101:             * Get the vendor specific error code
102:             *
103:             * @return a string specifying the vendor specific error code
104:             */
105:            public String getErrorCode() {
106:                return this .errorCode;
107:            }
108:
109:            /**
110:             * Get the linked exception 
111:             *
112:             * @return the linked Exception, null if none exists
113:             */
114:            public Throwable getLinkedException() {
115:                return linkedException;
116:            }
117:
118:            /**
119:             * Add a linked Exception.
120:             *
121:             * @param exception the linked Exception (A null value is permitted and 
122:             *                  indicates that the linked exception does not exist or
123:             *                  is unknown).
124:             */
125:            public synchronized void setLinkedException(Throwable exception) {
126:                this .linkedException = exception;
127:            }
128:
129:            /**
130:             * Returns a short description of this TypeConstraintException.
131:             *
132:             */
133:            public String toString() {
134:                return linkedException == null ? super .toString() : super 
135:                        .toString()
136:                        + "\n - with linked exception:\n["
137:                        + linkedException.toString() + "]";
138:            }
139:
140:            /**
141:             * Prints this TypeConstraintException and its stack trace (including the stack trace
142:             * of the linkedException if it is non-null) to the PrintStream.
143:             *
144:             * @param s PrintStream to use for output
145:             */
146:            public void printStackTrace(java.io.PrintStream s) {
147:                if (linkedException != null) {
148:                    linkedException.printStackTrace(s);
149:                    s.println("--------------- linked to ------------------");
150:                }
151:
152:                super .printStackTrace(s);
153:            }
154:
155:            /**
156:             * Prints this TypeConstraintException and its stack trace (including the stack trace
157:             * of the linkedException if it is non-null) to <tt>System.err</tt>.
158:             *
159:             */
160:            public void printStackTrace() {
161:                printStackTrace(System.err);
162:            }
163:
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.