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.
ClassNotFoundException
,
Serialized FormConstructor and Description |
---|
TypeNotPresentException(String typeName,
Throwable cause)
Constructs a
TypeNotPresentException for
the supplied type. |
Modifier and Type | Method and Description |
---|---|
String |
typeName()
Returns the name of the missing type.
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public TypeNotPresentException(String typeName, Throwable cause)
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.typeName
- the name of the missing type.cause
- the cause of this exception, or null if the cause
is unknown.