blob: 127c754b2ccbd7524b04ae97c0590be67ed00df5 [file] [log] [blame]
Christian van Spaandonk63814412008-08-02 09:56:01 +00001/*
Richard S. Hall8df9ab12009-07-24 17:06:37 +00002 * Copyright (c) OSGi Alliance (2006, 2008). All Rights Reserved.
Christian van Spaandonk63814412008-08-02 09:56:01 +00003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package info.dmtree;
18
19/**
Richard S. Hall8df9ab12009-07-24 17:06:37 +000020 * Unchecked illegal state exception. This class is used in DMT because
Christian van Spaandonk63814412008-08-02 09:56:01 +000021 * java.lang.IllegalStateException does not exist in CLDC.
Richard S. Hall8df9ab12009-07-24 17:06:37 +000022 *
23 * @version $Revision: 6083 $
Christian van Spaandonk63814412008-08-02 09:56:01 +000024 */
25public class DmtIllegalStateException extends RuntimeException {
26 private static final long serialVersionUID = 2015244852018469700L;
27
28 /**
Christian van Spaandonk63814412008-08-02 09:56:01 +000029 * Create an instance of the exception with no message.
30 */
31 public DmtIllegalStateException() {
32 super();
Christian van Spaandonk63814412008-08-02 09:56:01 +000033 }
34
35 /**
36 * Create an instance of the exception with the specified message.
37 *
38 * @param message the reason for the exception
39 */
40 public DmtIllegalStateException(String message) {
41 super(message);
Christian van Spaandonk63814412008-08-02 09:56:01 +000042 }
43
44 /**
45 * Create an instance of the exception with the specified cause exception
46 * and no message.
47 *
48 * @param cause the cause of the exception
49 */
50 public DmtIllegalStateException(Throwable cause) {
Richard S. Hall8df9ab12009-07-24 17:06:37 +000051 super(cause);
Christian van Spaandonk63814412008-08-02 09:56:01 +000052 }
53
54 /**
55 * Create an instance of the exception with the specified message and cause
56 * exception.
57 *
58 * @param message the reason for the exception
59 * @param cause the cause of the exception
60 */
61 public DmtIllegalStateException(String message, Throwable cause) {
Richard S. Hall8df9ab12009-07-24 17:06:37 +000062 super(message, cause);
Christian van Spaandonk63814412008-08-02 09:56:01 +000063 }
64
Richard S. Hall8df9ab12009-07-24 17:06:37 +000065 /**
66 * Returns the cause of this exception or <code>null</code> if no cause was
67 * set.
68 *
69 * @return The cause of this exception or <code>null</code> if no cause was
70 * set.
71 */
Christian van Spaandonk63814412008-08-02 09:56:01 +000072 public Throwable getCause() {
Richard S. Hall8df9ab12009-07-24 17:06:37 +000073 return super.getCause();
74 }
75
76 /**
77 * Initializes the cause of this exception to the specified value.
78 *
79 * @param cause The cause of this exception.
80 * @return This exception.
81 * @throws IllegalArgumentException If the specified cause is this
82 * exception.
83 * @throws IllegalStateException If the cause of this exception has already
84 * been set.
85 * @since 1.0.1
86 */
87 public Throwable initCause(Throwable cause) {
88 return super.initCause(cause);
Christian van Spaandonk63814412008-08-02 09:56:01 +000089 }
90}