|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.cas.client.util.ReflectUtils
public final class ReflectUtils
Helper class with reflection utility methods.
| Method Summary | ||
|---|---|---|
static PropertyDescriptor |
getPropertyDescriptor(BeanInfo info,
String propertyName)
Gets the property descriptor for the named property from the bean info describing a particular class to which property belongs. |
|
static PropertyDescriptor |
getPropertyDescriptor(Class<?> clazz,
String propertyName)
Gets the property descriptor for the named property on the given class. |
|
static
|
loadClass(String className)
Attempts to create a class from a String. |
|
static
|
newInstance(Class<T> clazz,
Object... args)
Creates a new instance of the given class by passing the given arguments to the constructor. |
|
static
|
newInstance(String className,
Object... args)
Creates a new instance of the given class by passing the given arguments to the constructor. |
|
static void |
setProperty(String propertyName,
Object value,
Object target)
Sets the given property on the target JavaBean using bean instrospection. |
|
static void |
setProperty(String propertyName,
Object value,
Object target,
BeanInfo info)
Sets the given property on the target JavaBean using bean instrospection. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> Class<T> loadClass(String className)
throws IllegalArgumentException
className - the name of the class to create.
IllegalArgumentException - if the className does not exist.
public static <T> T newInstance(String className,
Object... args)
className - Name of class to be created.args - Constructor arguments.
public static <T> T newInstance(Class<T> clazz,
Object... args)
clazz - Class of instance to be created.args - Constructor arguments.
public static PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
String propertyName)
clazz - Class to which property belongs.propertyName - Name of property.
public static PropertyDescriptor getPropertyDescriptor(BeanInfo info,
String propertyName)
info - Bean info describing class to which property belongs.propertyName - Name of property.
public static void setProperty(String propertyName,
Object value,
Object target)
propertyName - Property to set.value - Property value to set.target - Target java bean on which to set property.
public static void setProperty(String propertyName,
Object value,
Object target,
BeanInfo info)
propertyName - Property to set.value - Property value to set.target - Target JavaBean on which to set property.info - BeanInfo describing the target JavaBean.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||