KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > util > gui > resource > ResourceFormatException


1 /*
2
3    Copyright 2000 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.util.gui.resource;
19
20 /**
21  * Signals a format error in a resource bundle
22  *
23  * @author <a HREF="mailto:stephane@hillion.org">Stephane Hillion</a>
24  * @version $Id: ResourceFormatException.java,v 1.4 2005/03/27 08:58:37 cam Exp $
25  */

26 public class ResourceFormatException extends RuntimeException JavaDoc {
27     /**
28      * The class name of the resource bundle requested
29      * @serial
30      */

31     protected String JavaDoc className;
32
33     /**
34      * The name of the specific resource requested by the user
35      * @serial
36      */

37     protected String JavaDoc key;
38
39     /**
40      * Constructs a ResourceFormatException with the specified information.
41      * A detail message is a String that describes this particular exception.
42      * @param s the detail message
43      * @param className the name of the resource class
44      * @param key the key for the malformed resource.
45      */

46     public ResourceFormatException(String JavaDoc s, String JavaDoc className, String JavaDoc key) {
47         super(s);
48         this.className = className;
49         this.key = key;
50     }
51
52     /**
53      * Gets parameter passed by constructor.
54      */

55     public String JavaDoc getClassName() {
56         return className;
57     }
58
59     /**
60      * Gets parameter passed by constructor.
61      */

62     public String JavaDoc getKey() {
63         return key;
64     }
65
66     /**
67      * Returns a printable representation of this object
68      */

69     public String JavaDoc toString() {
70     return super.toString()+" ("+getKey()+", bundle: "+getClassName()+")";
71     }
72 }
73
Popular Tags