@Override public Object calculate(JtwigContext context) throws CalculateException { try { return context.function(getName()).execute(arguments(context)); } catch (FunctionException e) { throw new CalculateException(e); } catch (FunctionNotFoundException e) { throw new CalculateException(e); } }
@Override public Object calculate(JtwigContext context) throws CalculateException { try { return context.function(getName()).execute(arguments(context)); } catch (FunctionException e) { throw new CalculateException(e); } catch (FunctionNotFoundException e) { throw new CalculateException(e); } }
@Override public Object calculate(JtwigContext context) throws CalculateException { try { Object resolved = expression.calculate(context); for (FunctionElement functionElement : filters) { List<Object> arguments = new ListBuilder<Object>() .add(resolved) .add(functionElement.getArguments().calculate(context).toArray()) .build(); resolved = context.function(functionElement.getName()).execute(arguments.toArray()); } return resolved; } catch (FunctionException e) { throw new CalculateException(e); } catch (FunctionNotFoundException e) { throw new CalculateException(e); } } }
@Override public Object calculate(JtwigContext context) throws CalculateException { try { Object resolved = expression.calculate(context); for (FunctionElement functionElement : filters) { List<Object> arguments = new ListBuilder<Object>() .add(resolved) .add(functionElement.getArguments().calculate(context).toArray()) .build(); resolved = context.function(functionElement.getName()).execute(arguments.toArray()); } return resolved; } catch (FunctionException e) { throw new CalculateException(e); } catch (FunctionNotFoundException e) { throw new CalculateException(e); } } }