KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > IllegalArgumentException


1 /*
2  * @(#)IllegalArgumentException.java 1.23 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang;
9
10 /**
11  * Thrown to indicate that a method has been passed an illegal or
12  * inappropriate argument.
13  *
14  * @author unascribed
15  * @version 1.23, 12/19/03
16  * @see java.lang.Thread#setPriority(int)
17  * @since JDK1.0
18  */

19 public
20 class IllegalArgumentException extends RuntimeException JavaDoc {
21     /**
22      * Constructs an <code>IllegalArgumentException</code> with no
23      * detail message.
24      */

25     public IllegalArgumentException() {
26     super();
27     }
28
29     /**
30      * Constructs an <code>IllegalArgumentException</code> with the
31      * specified detail message.
32      *
33      * @param s the detail message.
34      */

35     public IllegalArgumentException(String JavaDoc s) {
36     super(s);
37     }
38
39     /**
40      * Constructs a new exception with the specified detail message and
41      * cause.
42      *
43      * <p>Note that the detail message associated with <code>cause</code> is
44      * <i>not</i> automatically incorporated in this exception's detail
45      * message.
46      *
47      * @param message the detail message (which is saved for later retrieval
48      * by the {@link Throwable#getMessage()} method).
49      * @param cause the cause (which is saved for later retrieval by the
50      * {@link Throwable#getCause()} method). (A <tt>null</tt> value
51      * is permitted, and indicates that the cause is nonexistent or
52      * unknown.)
53      * @since 1.5
54      */

55     public IllegalArgumentException(String JavaDoc message, Throwable JavaDoc cause) {
56         super(message, cause);
57     }
58  
59     /**
60      * Constructs a new exception with the specified cause and a detail
61      * message of <tt>(cause==null ? null : cause.toString())</tt> (which
62      * typically contains the class and detail message of <tt>cause</tt>).
63      * This constructor is useful for exceptions that are little more than
64      * wrappers for other throwables (for example, {@link
65      * java.security.PrivilegedActionException}).
66      *
67      * @param cause the cause (which is saved for later retrieval by the
68      * {@link Throwable#getCause()} method). (A <tt>null</tt> value is
69      * permitted, and indicates that the cause is nonexistent or
70      * unknown.)
71      * @since 1.5
72      */

73     public IllegalArgumentException(Throwable JavaDoc cause) {
74         super(cause);
75     }
76
77     private static final long serialVersionUID = -5365630128856068164L;
78 }
79
Popular Tags