Search in sources :

Example 1 with EasyPredicateParser

use of org.apache.camel.jsonpath.easypredicate.EasyPredicateParser in project camel by apache.

the class JsonPathExpression method init.

public void init() {
    String exp = expression;
    if (predicate && isAllowEasyPredicate()) {
        EasyPredicateParser parser = new EasyPredicateParser();
        exp = parser.parse(expression);
        if (!exp.equals(expression)) {
            LOG.debug("EasyPredicateParser parsed {} -> {}", expression, exp);
        }
    }
    LOG.debug("Initializing {} using: {}", predicate ? "predicate" : "expression", exp);
    try {
        engine = new JsonPathEngine(exp, suppressExceptions, allowSimple, options);
    } catch (Exception e) {
        throw new ExpressionIllegalSyntaxException(exp, e);
    }
}
Also used : ExpressionIllegalSyntaxException(org.apache.camel.ExpressionIllegalSyntaxException) EasyPredicateParser(org.apache.camel.jsonpath.easypredicate.EasyPredicateParser) ExpressionEvaluationException(org.apache.camel.ExpressionEvaluationException) ExpressionIllegalSyntaxException(org.apache.camel.ExpressionIllegalSyntaxException)

Aggregations

ExpressionEvaluationException (org.apache.camel.ExpressionEvaluationException)1 ExpressionIllegalSyntaxException (org.apache.camel.ExpressionIllegalSyntaxException)1 EasyPredicateParser (org.apache.camel.jsonpath.easypredicate.EasyPredicateParser)1