|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.anasoft.os.daofusion.util.ReflectionHelper
public final class ReflectionHelper
Helper class for common reflection operations.
Method Summary | |
---|---|
static java.lang.Object |
invokeGetterMethod(java.lang.Object object,
java.lang.String propertyName)
Tries to invoke a getter method for the given propertyName on the provided object. |
static java.lang.Object |
resolvePropertyPath(java.lang.Object object,
java.lang.String propertyPath)
Tries to resolve the given dot-separated propertyPath on the provided object by traversing its properties. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.Object invokeGetterMethod(java.lang.Object object, java.lang.String propertyName)
Note that the getter method should meet the following requirements:
object
- Object on which to invoke the getter method.propertyName
- Name of the property containing the requested value.
public static java.lang.Object resolvePropertyPath(java.lang.Object object, java.lang.String propertyPath)
This is a convenient way of accessing nested properties of a root object programatically.
Note that the method is null-friendly - it won't throw
a NullPointerException
during the object traversal
(a null value is returned instead).
object
- Object on which to resolve the property path.propertyPath
- Dot-separated logical path to the target
property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |