public void invoke() throws InvocationTargetException,
            IllegalAccessException {
        Object valueToPass = value;

        if (valueToPass != null && valueToPass instanceof LazyGetterMethod) {
            valueToPass = ((LazyGetterMethod) valueToPass).invoke();
        }

        expression.setValue(target, valueToPass);
    }
public void invoke ( ) throws InvocationTargetException , IllegalAccessException { Object valueToPass = value ; if ( valueToPass != null && valueToPass instanceof LazyGetterMethod ) { valueToPass = ( ( LazyGetterMethod ) valueToPass ) . invoke ( ) ; } expression . setValue ( target , valueToPass ) ; }
Invokes the getter/setter chain based on the source object. First of all
the actual arguments are determined by invoking LazyGetterMethod objects
that have been passed during construction. Then the getter chain is
invoked to determine the actual object on which to invoke the setter.
Finally the setter is invoked with the actual arguments
<p>
Example of how the chaining works:
<p>
<code>
class A{
private B b;
<p>
public A(B b){
this.b = b;
}
<p>
public B getB(){
return b;
}
}
<p>
class B{
private String s;
<p>
public B(String s){
this.s = s;
}
<p>
public void setS(String s){
this.s = s;
}
}
</code>
<p>
<code>
new LazySetterMethod(new A(new B("")), "b.s", "value").invoke()
</code>
<p>
is equal to
<p>
<code>
new A(new B("")).getB().setS("test");
</code>
<p>
and
<p>
<code>
new LazySetterMethod(new A(new B("")), "b.s", new LazyGetterMethod(new B("lazyValue"), "s").invoke()
</code>
<p>
is equal to
<p>
<code>
new A(new B("")).getB().setS(new B("lazyValue").getS());
</code>

@throws InvocationTargetException #{@link Method#invoke(java.lang.Object, java.lang.Object[]) }
@throws IllegalAccessException    #{@link Method#invoke(java.lang.Object, java.lang.Object[]) }