public final class ReflectionHelper extends Object
Modifier and Type | Method and Description |
---|---|
static Object |
createInstance(Class<?> type)
This function creates a new instance of the requested type.
|
static Object |
createInstance(String className)
This function creates a new instance of the requested type.
|
static Field |
getField(Class<?> type,
String fieldName)
This function returns the field wrapper for the requested field
|
static ClassLoader |
getThreadContextClassLoader()
This function returns the thread context class loader.
|
static Class<?> |
getType(String className)
This function returns the class based on the class name.
|
static Object |
invokeMethod(Class<?> type,
Object instance,
String methodName,
Class<?>[] inputTypes,
Object[] input)
This function invokes the requested method.
|
public static ClassLoader getThreadContextClassLoader()
public static Class<?> getType(String className)
className
- The class name of the requested typepublic static Object createInstance(Class<?> type)
type
- The class typepublic static Object createInstance(String className)
className
- The class namepublic static Object invokeMethod(Class<?> type, Object instance, String methodName, Class<?>[] inputTypes, Object[] input)
type
- The class typeinstance
- The instancemethodName
- The method name to invokeinputTypes
- An array of input typesinput
- The method inputCopyright © 2009–2020 fax4j. All rights reserved.