Java Code Examples for org.apache.commons.jexl3.JxltEngine#Expression

The following examples show how to use org.apache.commons.jexl3.JxltEngine#Expression . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TemplateEngine.java    From commons-jexl with Apache License 2.0 6 votes vote down vote up
@Override
public JxltEngine.Expression createExpression(JexlInfo info, String expression) {
    if (info == null) {
        info = jexl.createInfo();
    }
    Exception xuel = null;
    TemplateExpression stmt = null;
    try {
        stmt = cache.get(expression);
        if (stmt == null) {
            stmt = parseExpression(info, expression, null);
            cache.put(expression, stmt);
        }
    } catch (JexlException xjexl) {
        xuel = new Exception(xjexl.getInfo(), "failed to parse '" + expression + "'", xjexl);
    }
    if (xuel != null) {
        if (jexl.isSilent()) {
            jexl.logger.warn(xuel.getMessage(), xuel.getCause());
            stmt = null;
        } else {
            throw xuel;
        }
    }
    return stmt;
}
 
Example 2
Source File: TemplateDebugger.java    From commons-jexl with Apache License 2.0 5 votes vote down vote up
/**
 * Position the debugger on the root of a template expression.
 * @param je the expression
 * @return true if the expression was a {@link TemplateExpression} instance, false otherwise
 */
public boolean debug(JxltEngine.Expression je) {
    if (je instanceof TemplateExpression) {
        TemplateEngine.TemplateExpression te = (TemplateEngine.TemplateExpression) je;
        return visit(te, this) != null;
    } else {
        return false;
    }
}
 
Example 3
Source File: ASTIdentifierAccessJxlt.java    From commons-jexl with Apache License 2.0 4 votes vote down vote up
public void setExpression(JxltEngine.Expression tp) {
    jxltExpr = tp;
}
 
Example 4
Source File: ASTIdentifierAccessJxlt.java    From commons-jexl with Apache License 2.0 4 votes vote down vote up
public JxltEngine.Expression getExpression() {
    return jxltExpr;
}