java.lang
Class TypeNotPresentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.TypeNotPresentException
- All Implemented Interfaces:
- Serializable
public class TypeNotPresentException
- extends RuntimeException
Thrown when a type is accessed using a String
-based
representation, but no definition of the supplied type is found.
This is effectively an unchecked equivalent of the existing
ClassNotFound
exception.
It may occur due to an attempt to load a missing class, interface or
annotation, or when an undefined type variable is accessed.
- Since:
- 1.5
- See Also:
ClassNotFoundException
,
Serialized Form
Method Summary |
String |
typeName()
Returns the name of the missing type. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
TypeNotPresentException
public TypeNotPresentException(String typeName,
Throwable cause)
- Constructs a
TypeNotPresentException
for
the supplied type. The specified cause Throwable
may be used to provide additional history, with regards to the
root of the problem. It is perfectly valid for this to be null,
if the cause of the problem is unknown.
- Parameters:
typeName
- the name of the missing type.cause
- the cause of this exception, or null if the cause
is unknown.
typeName
public String typeName()
- Returns the name of the missing type.
- Returns:
- the missing type's name.