1 |
/* TypeNotPresentException.java |
/* TypeNotPresentException.java -- Thrown when a string-based type is missing |
2 |
Copyright (C) 2004 Free Software Foundation, Inc. |
Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
38 |
|
|
39 |
package java.lang; |
package java.lang; |
40 |
|
|
41 |
public class TypeNotPresentException extends RuntimeException |
/** |
42 |
|
* <p> |
43 |
|
* Thrown when a type is accessed using a <code>String</code>-based |
44 |
|
* representation, but no definition of the supplied type is found. |
45 |
|
* This is effectively an unchecked equivalent of the existing |
46 |
|
* <code>ClassNotFound</code> exception. |
47 |
|
* </p> |
48 |
|
* <p> |
49 |
|
* It may occur due to an attempt to load a missing class, interface or |
50 |
|
* annotation, or when an undefined type variable is accessed. |
51 |
|
* </p> |
52 |
|
* |
53 |
|
* @author Tom Tromey (tromey@redhat.com) |
54 |
|
* @author Andrew John Hughes (gnu_andrew@member.fsf.org) |
55 |
|
* @see ClassNotFoundException |
56 |
|
* @since 1.5 |
57 |
|
*/ |
58 |
|
public class TypeNotPresentException |
59 |
|
extends RuntimeException |
60 |
{ |
{ |
61 |
|
|
62 |
|
/** |
63 |
|
* Constructs a <code>TypeNotPresentException</code> for |
64 |
|
* the supplied type. The specified cause <code>Throwable</code> |
65 |
|
* may be used to provide additional history, with regards to the |
66 |
|
* root of the problem. It is perfectly valid for this to be null, |
67 |
|
* if the cause of the problem is unknown. |
68 |
|
* |
69 |
|
* @param typeName the name of the missing type. |
70 |
|
* @param cause the cause of this exception, or null if the cause |
71 |
|
* is unknown. |
72 |
|
*/ |
73 |
public TypeNotPresentException(String typeName, Throwable cause) |
public TypeNotPresentException(String typeName, Throwable cause) |
74 |
{ |
{ |
75 |
super("type \"" + typeName + "\" not found", cause); |
super("type \"" + typeName + "\" not found", cause); |
76 |
this.typeName = typeName; |
this.typeName = typeName; |
77 |
} |
} |
78 |
|
|
79 |
|
/** |
80 |
|
* Returns the name of the missing type. |
81 |
|
* |
82 |
|
* @return the missing type's name. |
83 |
|
*/ |
84 |
public String typeName() |
public String typeName() |
85 |
{ |
{ |
86 |
return typeName; |
return typeName; |
87 |
} |
} |
88 |
|
|
89 |
|
/** |
90 |
|
* The name of the missing type. |
91 |
|
* |
92 |
|
* @serial the missing type's name. |
93 |
|
*/ |
94 |
// Name fixed by serialization. |
// Name fixed by serialization. |
95 |
private String typeName; |
private String typeName; |
96 |
|
|
97 |
} |
} |