1/*
2
3   Licensed to the Apache Software Foundation (ASF) under one or more
4   contributor license agreements.  See the NOTICE file distributed with
5   this work for additional information regarding copyright ownership.
6   The ASF licenses this file to You under the Apache License, Version 2.0
7   (the "License"); you may not use this file except in compliance with
8   the License.  You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17
18 */
19package components;
20
21/**
22 * Signals a missing listener
23 *
24 * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
25 * @version $Id: MissingListenerException.java,v 1.1 2013/02/21 11:24:35 jschimpf Exp $
26 */
27public class MissingListenerException extends RuntimeException {
28    /**
29     * The class name of the listener bundle requested
30     * @serial
31     */
32    private String className;
33
34    /**
35     * The name of the specific listener requested by the user
36     * @serial
37     */
38    private String key;
39
40    /**
41     * Constructs a MissingListenerException with the specified information.
42     * A detail message is a String that describes this particular exception.
43     * @param s the detail message
44     * @param className the name of the listener class
45     * @param key the key for the missing listener.
46     */
47    public MissingListenerException(String s, String className, String key) {
48        super(s);
49        this.className = className;
50        this.key = key;
51    }
52
53    /**
54     * Gets parameter passed by constructor.
55     */
56    public String getClassName() {
57        return className;
58    }
59
60    /**
61     * Gets parameter passed by constructor.
62     */
63    public String getKey() {
64        return key;
65    }
66
67    /**
68     * Returns a printable representation of this object
69     */
70    public String toString() {
71        return super.toString()+" ("+getKey()+", bundle: "+getClassName()+")";
72    }
73}
74