Package com.sun.jna
Class Klass
- java.lang.Object
-
- com.sun.jna.Klass
-
abstract class Klass extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
newInstance(Class<T> klass)
Create a new instance for the givenklass
.
-
-
-
Method Detail
-
newInstance
public static <T> T newInstance(Class<T> klass)
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
-
-