KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sape > carbon > core > config > node > NodeException


1 /*
2  * The contents of this file are subject to the Sapient Public License
3  * Version 1.0 (the "License"); you may not use this file except in compliance
4  * with the License. You may obtain a copy of the License at
5  * http://carbon.sf.net/License.html.
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
9  * the specific language governing rights and limitations under the License.
10  *
11  * The Original Code is The Carbon Component Framework.
12  *
13  * The Initial Developer of the Original Code is Sapient Corporation
14  *
15  * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16  */

17
18 package org.sape.carbon.core.config.node;
19
20 import org.sape.carbon.core.config.ConfigurationException;
21
22 /**
23  * Base exception for all exceptions in the node package.
24  *
25  * Copyright 2002 Sapient
26  * @since carbon 1.0
27  * @author Douglas Voet, February 2002
28  * @version $Revision: 1.11 $($Author: dvoet $ / $Date: 2003/05/05 21:21:18 $)
29  */

30 public abstract class NodeException extends ConfigurationException {
31
32     /**
33      * The name of the node on which the exception occured.
34      */

35     protected String JavaDoc nodeName;
36
37     /**
38      * Constructs the base NodeException.
39      *
40      * @param sourceClass the class in which this exception was caused.
41      * @param nodeName the name of the configuration node to which this
42      * failure is related.
43      * @param message the message describing the failure and how to fix it.
44      * @param previousException the exception that may have caused this
45      * failure.
46      */

47     public NodeException(
48             Class JavaDoc sourceClass,
49             String JavaDoc nodeName,
50             String JavaDoc message,
51             Throwable JavaDoc previousException) {
52         super(sourceClass,
53                 "Node: [" + nodeName + "] " + message, previousException);
54         this.nodeName = nodeName;
55     }
56
57     /**
58      * Constructs the base NodeException.
59      *
60      * @param sourceClass the class in which this exception was caused.
61      * @param nodeName the name of the configuration node to which this
62      * failure is related.
63      * @param message the message describing the failure and how to fix it.
64      */

65     public NodeException(Class JavaDoc sourceClass, String JavaDoc nodeName, String JavaDoc message) {
66         super(sourceClass, "[" + nodeName + "] " + message);
67         this.nodeName = nodeName;
68     }
69
70     /**
71      * Retrieves the name of the node on which the exception occurred.
72      * @return the name of the node on which the exception occured.
73      * @since carbon 2.0
74      */

75     public String JavaDoc getNodeName() {
76         return this.nodeName;
77     }
78
79 }
80
Popular Tags