public class PropertyPathExpression<X,Y> extends Object implements ValueAccessor<X,Y>
| Constructor and Description |
|---|
PropertyPathExpression(Class<X> source,
String propertyPath) |
PropertyPathExpression(Class<X> source,
String propertyPath,
boolean allowFieldAccess) |
| Modifier and Type | Method and Description |
|---|---|
Y |
getNullSafeValue(X target) |
Y |
getValue(X target)
Invokes the getter chain based on the source object.
|
void |
setValue(X target,
Y value)
Sets the given value specified in the target object.
|
public final Y getValue(X target)
Example of how the chaining works:
class A{ B getB(){ // return b element } }
class B{ String getA(){ // return a element } }
new LazyGetterMethod(new A(), "a.b").invoke()
is equal to
new A().getB().getA()
getValue in interface ValueRetriever<X,Y>target - The target object from which to retrieve the value.InvocationTargetException - Method.invoke(java.lang.Object, java.lang.Object[])IllegalAccessException - Method.invoke(java.lang.Object, java.lang.Object[])public final void setValue(X target, Y value)
ValueAccessorRuntimeExceptions.setValue in interface ValueAccessor<X,Y>target - The target object on which to set the given value.value - The new value of the target object.Copyright © 2020 Blazebit. All rights reserved.