01: /* Licensed to the Apache Software Foundation (ASF) under one or more
02: * contributor license agreements. See the NOTICE file distributed with
03: * this work for additional information regarding copyright ownership.
04: * The ASF licenses this file to You under the Apache License, Version 2.0
05: * (the "License"); you may not use this file except in compliance with
06: * the License. You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package java.lang;
18:
19: /**
20: * <p>
21: * Indicates that a class, interface, enum or annotation type cannot be found.
22: * This exception is an unchecked alternative to
23: * {@link java.lang.ClassNotFoundException}.
24: * </p>
25: *
26: * @since 1.5
27: * @author Nathan Beyer (Harmony)
28: */
29: public class TypeNotPresentException extends RuntimeException {
30: private static final long serialVersionUID = -5101214195716534496L;
31:
32: private String typeName;
33:
34: /**
35: * <p>
36: * Constructs an instance will a fully qualified type name and an optional
37: * cause.
38: * </p>
39: *
40: * @param typeName The fully qualified type name.
41: * @param cause The <code>Throwable</code> that caused this exception or
42: * <code>null</code>.
43: */
44: public TypeNotPresentException(String typeName, Throwable cause) {
45: super ("Type " + typeName + " not present", cause);
46: this .typeName = typeName;
47: }
48:
49: /**
50: * <p>
51: * The fully qualified type name.
52: * </p>
53: *
54: * @return A String instance.
55: */
56: public String typeName() {
57: return typeName;
58: }
59: }
|