@Override public String getCurrentObjectName() { if (currentObjectName == null) { return super.getCurrentObjectName(); } return currentObjectName; }
@Override public String getIterObjectName() { if (iterObjectName == null) { return super.getIterObjectName(); } return iterObjectName; }
public final void execute(ExpressionContext context, TagNode tag, Writer out) throws TemplateEvaluationException, IOException { Object t = context.get(getCurrentObjectName()); Super ts = (Super) context.get(getParentObjectName()); Iter iter = (Iter) context.get(getIterObjectName()); Super s = null; if (t != null) { s = new Super(t, ts, iter); context.put(getParentObjectName(), s); } doExecute(context, tag, out); if (t != null) { context.put(getCurrentObjectName(), s.get()); context.put(getParentObjectName(), s.getSuper()); context.put(getIterObjectName(), s.getIter()); } else { context.put(getCurrentObjectName(), t); context.put(getParentObjectName(), ts); context.put(getIterObjectName(), iter); } }
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 String getCurrentObjectName() { if (currentObjectName == null) { return super.getCurrentObjectName(); } return currentObjectName; }