Source Home >> Java Source 1.6.0 >> java.lang.IllegalStateException V 0.09
  • 01/*
  • 02 * @(#)IllegalStateException.java 1.16 05/11/17
  • 03 *
  • 04 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
  • 05 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  • 06 */
  • 07
  • 08package java.lang;
  • 09
  • 10/**
  • 11 * Signals that a method has been invoked at an illegal or
  • 12 * inappropriate time. In other words, the Java environment or
  • 13 * Java application is not in an appropriate state for the requested
  • 14 * operation.
  • 15 *
  • 16 * @author Jonni Kanerva
  • 17 * @version 1.16, 11/17/05
  • 18 * @since JDK1.1
  • 19 */
  • 20public
  • 21class IllegalStateException extends RuntimeException {
  • 22 /**
  • 23 * Constructs an IllegalStateException with no detail message.
  • 24 * A detail message is a String that describes this particular exception.
  • 25 */
  • 26 public IllegalStateException() {
  • 27 super();
  • 28 }
  • 29
  • 30 /**
  • 31 * Constructs an IllegalStateException with the specified detail
  • 32 * message. A detail message is a String that describes this particular
  • 33 * exception.
  • 34 *
  • 35 * @param s the String that contains a detailed message
  • 36 */
  • 37 public IllegalStateException(String s) {
  • 38 super(s);
  • 39 }
  • 40
  • 41 /**
  • 42 * Constructs a new exception with the specified detail message and
  • 43 * cause.
  • 44 *
  • 45 * <p>Note that the detail message associated with <code>cause</code> is
  • 46 * <i>not</i> automatically incorporated in this exception's detail
  • 47 * message.
  • 48 *
  • 49 * @param message the detail message (which is saved for later retrieval
  • 50 * by the {@link Throwable#getMessage()} method).
  • 51 * @param cause the cause (which is saved for later retrieval by the
  • 52 * {@link Throwable#getCause()} method). (A <tt>null</tt> value
  • 53 * is permitted, and indicates that the cause is nonexistent or
  • 54 * unknown.)
  • 55 * @since 1.5
  • 56 */
  • 57 public IllegalStateException(String message, Throwable cause) {
  • 58 super(message, cause);
  • 59 }
  • 60
  • 61 /**
  • 62 * Constructs a new exception with the specified cause and a detail
  • 63 * message of <tt>(cause==null ? null : cause.toString())</tt> (which
  • 64 * typically contains the class and detail message of <tt>cause</tt>).
  • 65 * This constructor is useful for exceptions that are little more than
  • 66 * wrappers for other throwables (for example, {@link
  • 67 * java.security.PrivilegedActionException}).
  • 68 *
  • 69 * @param cause the cause (which is saved for later retrieval by the
  • 70 * {@link Throwable#getCause()} method). (A <tt>null</tt> value is
  • 71 * permitted, and indicates that the cause is nonexistent or
  • 72 * unknown.)
  • 73 * @since 1.5
  • 74 */
  • 75 public IllegalStateException(Throwable cause) {
  • 76 super(cause);
  • 77 }
  • 78
  • 79 static final long serialVersionUID = -1848914673093119416L;
  • 80}

文件:IllegalStateException.java
包名:java.lang
类名:IllegalStateException
继承:RuntimeException
接口: