NEW: ExpressionPath provides access to property and elName (#1550)

This commit is contained in:
Roland Praml
2018-11-19 22:16:01 +13:00
committed by Rob Bygrave
parent 06b71781f5
commit 7be4675d3e
4 changed files with 27 additions and 0 deletions
@@ -73,4 +73,14 @@ public interface ExpressionPath {
* Return the Id values for the given bean value.
*/
Object[] getAssocIdValues(EntityBean bean);
/**
* Return the underlying bean property.
*/
public Property getProperty();
/**
* The ElPrefix plus name.
*/
String getElName();
}
@@ -1,6 +1,7 @@
package io.ebeaninternal.server.deploy;
import io.ebean.bean.EntityBean;
import io.ebean.plugin.Property;
import io.ebean.text.StringParser;
import io.ebeaninternal.api.SpiExpressionRequest;
import io.ebeaninternal.server.el.ElPropertyValue;
@@ -226,4 +227,9 @@ public final class BeanFkeyProperty implements ElPropertyValue {
throw new RuntimeException("ElPropertyDeploy only - not implemented");
}
@Override
public Property getProperty() {
throw new RuntimeException("ElPropertyDeploy only - not implemented");
}
}
@@ -676,6 +676,11 @@ public class BeanProperty implements ElPropertyValue, Property, STreeProperty {
return this;
}
@Override
public Property getProperty() {
return this;
}
/**
* Return true if this object is part of an inheritance hierarchy.
*/
@@ -1,6 +1,7 @@
package io.ebeaninternal.server.el;
import io.ebean.bean.EntityBean;
import io.ebean.plugin.Property;
import io.ebean.text.StringParser;
import io.ebean.util.StringHelper;
import io.ebeaninternal.api.SpiExpressionRequest;
@@ -211,6 +212,11 @@ public class ElPropertyChain implements ElPropertyValue {
return lastElPropertyValue.isAssocMany();
}
@Override
public Property getProperty() {
return lastBeanProperty;
}
@Override
public boolean isAssocId() {
return assocId;