Package com.sun.jna
Class Klass
java.lang.Object
com.sun.jna.Klass
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
newInstance
(Class<T> klass) Create a new instance for the givenklass
.
-
Method Details
-
newInstance
Create a new instance for the givenklass
. Runtime exceptions thrown from the constructor are rethrown, all other exceptions generated from the reflective call are wrapped into aIllegalArgumentException
and rethrown.- Parameters:
klass
- desired class to instantiate- Returns:
- the new instance
- Throws:
IllegalArgumentException
- if the instantiation failsRuntimeException
- if the constructor forklass
throws a runtime exception
-