use of org.apache.commons.jexl2.ObjectContext in project vorto by eclipse.
the class AbstractDataMapper method matchesCondition.
private boolean matchesCondition(Map<String, String> attributes, JXPathContext context) {
if (attributes.containsKey(ATTRIBUTE_CONDITION) && !attributes.get(ATTRIBUTE_CONDITION).equals("")) {
Expression e = JEXL.createExpression(normalizeCondition(attributes.get(ATTRIBUTE_CONDITION)));
JexlContext jc = new ObjectContext<Object>(JEXL, context.getContextBean());
jc.set("this", context.getContextBean());
return (boolean) e.evaluate(jc);
} else {
return true;
}
}
Aggregations