public void eval(ExpressionContext context, Writer out) throws IOException, TemplateEvaluationException { try { context.put(varName, expression.eval(context)); } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + expression.toString() + " on line: " + getBeginLine() + ", column: " + getBeginColumn(), getBeginLine(), getBeginColumn()); } }
public void eval(ExpressionContext context, Writer out) throws IOException, TemplateEvaluationException { try { Object value = expression.eval(context); if (value != null) { Locale locale = (Locale) context.get(DefaultTemplateBindings.LocaleVariable); if (locale == null) { locale = Locale.getDefault(); } String str = applyFilters(value, locale); if (raw) { out.write(str); } else { out.write(EscapeFilter.doFilter(str)); } } } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + getLine() + ", column: " + getColumn(), getLine(), getColumn()); } }
public void eval(ExpressionContext context, Writer out) throws IOException, TemplateEvaluationException { try { Object value = expression.eval(context); if (value != null) { String str = applyFilters(value, context.getLocale()); if (raw) { out.write(str); } else { out.write(EscapeFilter.doFilter(str)); } } } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + getBeginLine() + ", column: " + getBeginColumn(), getBeginLine(), getBeginColumn(), value); } }
b.modify(context, tag); } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + getBeginLine() + ", column: " + getBeginColumn(), getBeginLine(), getBeginColumn(), getTagName());
iterateBoolean(context, tag, out, (boolean[]) o); } else { throw new TemplateEvaluationException(null, "The provided expression value of class " + o.getClass().getName() + " for foreach attribute is not iterable, on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(), tag.getBeginLine(), tag.getBeginColumn()); throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage(), tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName());
@Override protected void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException { try { context.put(getCurrentObjectName(), expression.eval(context)); tag.execute(context, out); } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(), tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName()); } }
@Override public void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException { try { Iter iter = new Iter(); while (expression.asBoolean(context)) { context.put(Expressions.ITER_OBJECT, iter); tag.execute(context, out); iter.next(); } } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(), tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName()); } }
public void eval(ExpressionContext context, Writer out) throws IOException, TemplateEvaluationException { try { if (!isDynamic()) { printFragments(context, out); } else { if (conditionsMet(context)) { if (looping == null) { execute(context, out); } else { looping.execute(context, this, out); } } } } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + getBeginLine() + ", column: " + getBeginColumn(), getBeginLine(), getBeginColumn(), getTagName()); } }
@Override public void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException { try { Iter iter = new Iter(); int n = number.asInt(context); for (int i = 0; i != n; i++) { if (i == n - 1) { iter.setLast(); } context.put(Expressions.CURRENT_OBJECT, i); context.put(Expressions.ITER_OBJECT, iter); tag.execute(context, out); iter.next(); } } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(), tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName()); } }
@Override public void doExecute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException { try { Iter iter = new Iter(); for (int i = from.asInt(context); i <= to.asInt(context); i++) { if (i == to.asInt(context)) iter.setLast(); context.put(Expressions.CURRENT_OBJECT, i); context.put(Expressions.ITER_OBJECT, iter); tag.execute(context, out); iter.next(); } } catch (ExpressionEvaluationException e) { throw new TemplateEvaluationException(e, "Could not execute the expression: " + e.getMessage() + ", on line: " + tag.getBeginLine() + ", column: " + tag.getBeginColumn(), tag.getBeginLine(), tag.getBeginColumn(), tag.getTagName()); } }
throw new TemplateEvaluationException(e, "Error evaluating expression", getBeginLine(), getBeginColumn());