public class UnknownGenericException
extends java.lang.RuntimeException
<T> void doSmth(List<T> arg1) if
we try to resolve generic of arg1, it will fail, because generic T is only known within method scope
(resolve parameters and resolve method return type api correctly support such generics, but its hard to support it
in general case).| Constructor and Description |
|---|
UnknownGenericException(java.lang.Class contextType,
java.lang.String genericName) |
UnknownGenericException(java.lang.String genericName) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Class |
getContextType() |
java.lang.String |
getGenericName() |
UnknownGenericException |
rethrowWithType(java.lang.Class type)
Throw more specific exception.
|
public UnknownGenericException(java.lang.String genericName)
genericName - generic namepublic UnknownGenericException(java.lang.Class contextType,
java.lang.String genericName)
contextType - context type (may be null)genericName - generic namepublic java.lang.String getGenericName()
public java.lang.Class getContextType()
public UnknownGenericException rethrowWithType(java.lang.Class type)
type - context type