com.is.util
Class KeyPathHelper

java.lang.Object
  |
  +--com.is.util.KeyPathHelper

public class KeyPathHelper
extends java.lang.Object

This class executes recursive getter methods (no parameters) using reflection. i.e. If you have an Employee instance that has a Manager instance, you could get the name of the employees manager with this key path string: "getManager.getName"


Inner Class Summary
static class KeyPathHelper.KeyPathException
           
 
Constructor Summary
KeyPathHelper()
           
 
Method Summary
static java.lang.Object getValueForKeyPath(java.lang.Object obj, java.lang.String keyPath)
          Recursively execute methods on the result of the previous method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyPathHelper

public KeyPathHelper()
Method Detail

getValueForKeyPath

public static java.lang.Object getValueForKeyPath(java.lang.Object obj,
                                                  java.lang.String keyPath)
                                           throws KeyPathHelper.KeyPathException
Recursively execute methods on the result of the previous method.
Parameters:
obj - a value of type 'Object' - i.e. an Employee instance
keyPath - a value of type 'String' - i.e. "getManager.getName"
Returns:
a value of type 'Object' - i.e. returns the managers name