|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.acsinet_solutions.util.ReflectionUtils
public final class ReflectionUtils
Useful reflection utility methods
| Method Summary | |
|---|---|
static void |
addValue(java.lang.Object bean,
java.lang.String property,
java.lang.Object value)
Add a property to a bean object. |
static boolean |
correspond(java.lang.reflect.Method method1,
java.lang.reflect.Method method2)
Check if the methods correspond to the same name and arguments. |
static java.lang.Class |
getClassFor(java.lang.String className)
|
static java.util.Set<java.lang.Object> |
getConstantSet(java.lang.Class c,
java.lang.String suffix)
Create a Set of the constants included in the given class that end with the provided suffix. |
static java.lang.reflect.Constructor |
getConstructor(java.lang.Class c,
java.lang.Class[] args)
Get the a constructor for the given class; throws a runtime exception |
static java.lang.Object |
getProperty(java.lang.Object bean,
java.lang.String property)
Get a maybe-nested property of a bean object. |
static java.lang.String |
getPropertyFromGetterName(java.lang.String name)
Get a property name from a getter name. |
static boolean |
hasReadProperty(java.lang.Object bean,
java.lang.String property)
Thin wrapper around BeanUtils to check if a read property exists |
static boolean |
hasWriteProperty(java.lang.Object bean,
java.lang.String property)
Thin wrapper around BeanUtils to check if a write property exists |
static java.lang.Object |
newInstance(java.lang.String className,
java.lang.Class paramClass,
java.lang.Object param)
Create a new instance of the given class name using a single-parameter constructor |
static void |
setProperty(java.lang.Object bean,
java.lang.String property,
java.lang.Object value)
Set a property to a bean object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final java.lang.Class getClassFor(java.lang.String className)
throws java.lang.ClassNotFoundException
className - A not-null valid Class FQN avalable to the class loader.
Primitive names are valid values for this method ( in contrast to
Class.forName() ).
java.lang.ClassNotFoundException - Thrown if the class instance could not be obtained
public static final java.lang.Object newInstance(java.lang.String className,
java.lang.Class paramClass,
java.lang.Object param)
throws java.lang.Exception
className - The not-null valid name of the class to be instanciatedparamClass - The not-null class type of the constructor parameterparam - The valid not-null single-parameter of the class constructor
java.lang.Exception
public static final java.lang.reflect.Constructor getConstructor(java.lang.Class c,
java.lang.Class[] args)
c - A not-null classargs - A not-null class array
public static final java.util.Set<java.lang.Object> getConstantSet(java.lang.Class c,
java.lang.String suffix)
public static final boolean hasReadProperty(java.lang.Object bean,
java.lang.String property)
public static final boolean hasWriteProperty(java.lang.Object bean,
java.lang.String property)
public static final java.lang.Object getProperty(java.lang.Object bean,
java.lang.String property)
throws java.lang.RuntimeException
java.lang.RuntimeException
public static final void setProperty(java.lang.Object bean,
java.lang.String property,
java.lang.Object value)
throws java.lang.RuntimeException
java.lang.RuntimeException
public static final void addValue(java.lang.Object bean,
java.lang.String property,
java.lang.Object value)
throws java.lang.RuntimeException
java.lang.RuntimeExceptionpublic static final java.lang.String getPropertyFromGetterName(java.lang.String name)
public static final boolean correspond(java.lang.reflect.Method method1,
java.lang.reflect.Method method2)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||