public class ReflectionUtil
extends java.lang.Object
Constructor and Description |
---|
ReflectionUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
newInstance(java.lang.Class<T> theClass) |
static <T> T |
newInstance(java.lang.Class<T> theClass,
java.lang.Class<?> paramClass,
java.lang.Object paramValue)
Create an object for the given class and initialize it from conf
|
static <T> T |
newInstance(java.lang.Class<T> theClass,
Configuration conf)
Create an object for the given class and initialize it from conf
|
static void |
setConf(java.lang.Object theObject,
Configuration conf)
Check and set 'configuration' if necessary.
|
public static <T> T newInstance(java.lang.Class<T> theClass, java.lang.Class<?> paramClass, java.lang.Object paramValue)
T
- type parametertheClass
- a given Class objectparamClass
- Class type of the constructorparamValue
- object for the constructorpublic static <T> T newInstance(java.lang.Class<T> theClass, Configuration conf)
T
- type parametertheClass
- class of which an object is createdconf
- Configurationpublic static <T> T newInstance(java.lang.Class<T> theClass)
public static void setConf(java.lang.Object theObject, Configuration conf)
theObject
- object for which to set configurationconf
- ConfigurationCopyright © 2017. All Rights Reserved.