public Method resolveFunction(String prefix, String localName) { for (FunctionMapper functionMapper : functionMappers) { Method method = functionMapper.resolveFunction(prefix, localName); if (method != null) { return method; } } throw LOG.unknownFunction(prefix, localName); }
protected ValueExpression transformSimpleUnaryTests(String simpleUnaryTests, String inputName, ELContext elContext) { String juelExpression = transformToJuelExpression(simpleUnaryTests, inputName); try { return expressionFactory.createValueExpression(elContext, juelExpression, Object.class); } catch (ELException e) { throw LOG.invalidExpression(simpleUnaryTests, e); } }
public boolean evaluateSimpleUnaryTests(String simpleUnaryTests, String inputName, VariableContext variableContext) { try { ELContext elContext = createContext(variableContext); ValueExpression valueExpression = transformSimpleUnaryTests(simpleUnaryTests, inputName, elContext); return (Boolean) valueExpression.getValue(elContext); } catch (FeelMissingFunctionException e) { throw LOG.unknownFunction(simpleUnaryTests, e); } catch (FeelMissingVariableException e) { if (inputName.equals(e.getVariable())) { throw LOG.unableToEvaluateExpressionAsNotInputIsSet(simpleUnaryTests, e); } else { throw LOG.unknownVariable(simpleUnaryTests, e); } } catch (FeelConvertException e) { throw LOG.unableToConvertValue(simpleUnaryTests, e); } catch (ELException e) { if (e.getCause() instanceof FeelMethodInvocationException) { throw LOG.unableToInvokeMethod(simpleUnaryTests, (FeelMethodInvocationException) e.getCause()); } else { throw LOG.unableToEvaluateExpression(simpleUnaryTests, e); } } }
public boolean evaluateSimpleUnaryTests(String simpleUnaryTests, String inputName, VariableContext variableContext) { try { ELContext elContext = createContext(variableContext); ValueExpression valueExpression = transformSimpleUnaryTests(simpleUnaryTests, inputName, elContext); return (Boolean) valueExpression.getValue(elContext); } catch (FeelMissingFunctionException e) { throw LOG.unknownFunction(simpleUnaryTests, e); } catch (FeelMissingVariableException e) { if (inputName.equals(e.getVariable())) { throw LOG.unableToEvaluateExpressionAsNotInputIsSet(simpleUnaryTests, e); } else { throw LOG.unknownVariable(simpleUnaryTests, e); } } catch (FeelConvertException e) { throw LOG.unableToConvertValue(simpleUnaryTests, e); } catch (ELException e) { if (e.getCause() instanceof FeelMethodInvocationException) { throw LOG.unableToInvokeMethod(simpleUnaryTests, (FeelMethodInvocationException) e.getCause()); } else { throw LOG.unableToEvaluateExpression(simpleUnaryTests, e); } } }
public ValueExpression resolveVariable(String variable) { if (variableContext.containsVariable(variable)) { Object value = unpackVariable(variable); return expressionFactory.createValueExpression(value, Object.class); } else { throw LOG.unknownVariable(variable); } }
public Method resolveFunction(String prefix, String localName) { for (FunctionMapper functionMapper : functionMappers) { Method method = functionMapper.resolveFunction(prefix, localName); if (method != null) { return method; } } throw LOG.unknownFunction(prefix, localName); }
protected ValueExpression transformSimpleUnaryTests(String simpleUnaryTests, String inputName, ELContext elContext) { String juelExpression = transformToJuelExpression(simpleUnaryTests, inputName); try { return expressionFactory.createValueExpression(elContext, juelExpression, Object.class); } catch (ELException e) { throw LOG.invalidExpression(simpleUnaryTests, e); } }
public ValueExpression resolveVariable(String variable) { if (variableContext.containsVariable(variable)) { Object value = unpackVariable(variable); return expressionFactory.createValueExpression(value, Object.class); } else { throw LOG.unknownVariable(variable); } }