Source Code Cross Referenced for AssertionError.java in  » 6.0-JDK-Core » lang » java » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » lang » java.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2000-2006 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025
026        package java.lang;
027
028        /**
029         * Thrown to indicate that an assertion has failed.
030         *
031         * <p>The seven one-argument public constructors provided by this
032         * class ensure that the assertion error returned by the invocation:
033         * <pre>
034         *     new AssertionError(<i>expression</i>)
035         * </pre>
036         * has as its detail message the <i>string conversion</i> of
037         * <i>expression</i> (as defined in <a
038         * href="http://java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html">
039         * <i>The Java Language Specification, Second Edition</i></a>, 
040         * <a href="http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#40220">
041         * Section  15.18.1.1</a>), regardless of the type of <i>expression</i>.
042         *
043         * @version 1.15, 05/05/07
044         * @since   1.4
045         */
046        public class AssertionError extends Error {
047            /**
048             * Constructs an AssertionError with no detail message.
049             */
050            public AssertionError() {
051            }
052
053            /**
054             * This internal constructor does no processing on its string argument,
055             * even if it is a null reference.  The public constructors will
056             * never call this constructor with a null argument.
057             */
058            private AssertionError(String detailMessage) {
059                super (detailMessage);
060            }
061
062            /**
063             * Constructs an AssertionError with its detail message derived
064             * from the specified object, which is converted to a string as
065             * defined in <i>The Java Language Specification, Second
066             * Edition</i>, Section 15.18.1.1.
067             *<p>
068             * If the specified object is an instance of <tt>Throwable</tt>, it
069             * becomes the <i>cause</i> of the newly constructed assertion error.
070             *
071             * @param detailMessage value to be used in constructing detail message
072             * @see   Throwable#getCause()
073             */
074            public AssertionError(Object detailMessage) {
075                this ("" + detailMessage);
076                if (detailMessage instanceof  Throwable)
077                    initCause((Throwable) detailMessage);
078            }
079
080            /**
081             * Constructs an AssertionError with its detail message derived
082             * from the specified <code>boolean</code>, which is converted to
083             * a string as defined in <i>The Java Language Specification,
084             * Second Edition</i>, Section 15.18.1.1.
085             *
086             * @param detailMessage value to be used in constructing detail message
087             */
088            public AssertionError(boolean detailMessage) {
089                this ("" + detailMessage);
090            }
091
092            /**
093             * Constructs an AssertionError with its detail message derived
094             * from the specified <code>char</code>, which is converted to a
095             * string as defined in <i>The Java Language Specification, Second
096             * Edition</i>, Section 15.18.1.1.
097             *
098             * @param detailMessage value to be used in constructing detail message
099             */
100            public AssertionError(char detailMessage) {
101                this ("" + detailMessage);
102            }
103
104            /**
105             * Constructs an AssertionError with its detail message derived
106             * from the specified <code>int</code>, which is converted to a
107             * string as defined in <i>The Java Language Specification, Second
108             * Edition</i>, Section 15.18.1.1.
109             *
110             * @param detailMessage value to be used in constructing detail message
111             */
112            public AssertionError(int detailMessage) {
113                this ("" + detailMessage);
114            }
115
116            /**
117             * Constructs an AssertionError with its detail message derived
118             * from the specified <code>long</code>, which is converted to a
119             * string as defined in <i>The Java Language Specification, Second
120             * Edition</i>, Section 15.18.1.1.
121             *
122             * @param detailMessage value to be used in constructing detail message
123             */
124            public AssertionError(long detailMessage) {
125                this ("" + detailMessage);
126            }
127
128            /**
129             * Constructs an AssertionError with its detail message derived
130             * from the specified <code>float</code>, which is converted to a
131             * string as defined in <i>The Java Language Specification, Second
132             * Edition</i>, Section 15.18.1.1.
133             *
134             * @param detailMessage value to be used in constructing detail message
135             */
136            public AssertionError(float detailMessage) {
137                this ("" + detailMessage);
138            }
139
140            /**
141             * Constructs an AssertionError with its detail message derived
142             * from the specified <code>double</code>, which is converted to a
143             * string as defined in <i>The Java Language Specification, Second
144             * Edition</i>, Section 15.18.1.1.
145             *
146             * @param detailMessage value to be used in constructing detail message
147             */
148            public AssertionError(double detailMessage) {
149                this ("" + detailMessage);
150            }
151        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.