public final class ReflectionUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.reflect.Method |
findGetter(java.lang.Class<?> clazz,
java.lang.String name)
Finds the specified getter method on the specified class.
|
static java.beans.PropertyDescriptor |
findPropertyDescriptor(java.lang.Class<?> clazz,
java.lang.String name)
Returns the PropertyDescriptor for the given property.
|
static java.lang.reflect.Method |
findSetter(java.lang.Class<?> clazz,
java.lang.String name)
Finds the specified setter method on the specified class.
|
static java.beans.BeanInfo |
getBeanInfo(java.lang.Class<?> clazz)
Get
BeanInfo. |
static <T> T |
instantiate(java.lang.Class<T> clazz,
java.lang.Object... args)
Creates an instance of the given class.
|
public static <T> T instantiate(java.lang.Class<T> clazz,
java.lang.Object... args)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
T - the typeclazz - the classargs - the arguments to pass to the constructorjava.lang.InstantiationException - on errorjava.lang.IllegalAccessException - on errorjava.lang.reflect.InvocationTargetException - on errorpublic static java.beans.BeanInfo getBeanInfo(java.lang.Class<?> clazz)
BeanInfo.clazz - the classpublic static java.beans.PropertyDescriptor findPropertyDescriptor(java.lang.Class<?> clazz,
java.lang.String name)
clazz - the classname - the getter namepublic static java.lang.reflect.Method findGetter(java.lang.Class<?> clazz,
java.lang.String name)
clazz - the classname - the getter namepublic static java.lang.reflect.Method findSetter(java.lang.Class<?> clazz,
java.lang.String name)
clazz - the classname - the setter nameCopyright © 2013. All Rights Reserved.