KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > commands > common > CommandException


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.commands.common;
12
13 /**
14  * Signals that an exception occured within the command architecture.
15  * <p>
16  * This class is not intended to be extended by clients.
17  * </p>
18  *
19  * @since 3.1
20  */

21 public abstract class CommandException extends Exception JavaDoc {
22     
23     /**
24      * This member variable is required here to allow us to compile against JCL
25      * foundation libraries. The value may be <code>null</code>.
26      */

27     private Throwable JavaDoc cause;
28     
29     /**
30      * Creates a new instance of this class with the specified detail message.
31      *
32      * @param message
33      * the detail message; may be <code>null</code>.
34      */

35     public CommandException(final String JavaDoc message) {
36         super(message);
37     }
38
39     /**
40      * Creates a new instance of this class with the specified detail message
41      * and cause.
42      *
43      * @param message
44      * the detail message; may be <code>null</code>.
45      * @param cause
46      * the cause; may be <code>null</code>.
47      */

48     public CommandException(final String JavaDoc message, final Throwable JavaDoc cause) {
49         super(message);
50         // don't pass the cause to super, to allow compilation against JCL Foundation
51
this.cause = cause;
52     }
53     
54     /**
55      * Returns the cause of this throwable or <code>null</code> if the
56      * cause is nonexistent or unknown.
57      *
58      * @return the cause or <code>null</code>
59      */

60     public Throwable JavaDoc getCause() {
61         return cause;
62     }
63     
64 }
65
Popular Tags