public static Object not (Object a) { return !isTrue(a); }
public static Object not (Object a) { return !isTrue(a); }
@Override public Object calculate(JtwigContext context) throws CalculateException { if (isTrue(booleanExpression.calculate(context))) return ifTrueExpression.calculate(context); else return ifFalseExpression.calculate(context); } }
@Override public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException { try { if (isTrue(condition.calculate(context))) { return content.render(outputStream, context); } return false; } catch (CalculateException e) { throw new RenderException(e); } }
@Override public Object calculate(JtwigContext context) throws CalculateException { if (isTrue(booleanExpression.calculate(context))) return ifTrueExpression.calculate(context); else return ifFalseExpression.calculate(context); } }
@Override public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException { try { if (isTrue(condition.calculate(context))) { return content.render(outputStream, context); } return false; } catch (CalculateException e) { throw new RenderException(e); } }
@Override public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException { try { if (isTrue(conditionalExpression.calculate(context))) { return content.render(outputStream, context); } else { for (ElseIfExpression exp : elseIfExpressions) { if (exp.render(outputStream, context)) return true; } if (elseExpression != null) { return elseExpression.render(outputStream, context); } return true; } } catch (CalculateException e) { throw new RenderException(e); } }
@Override public boolean render(OutputStream outputStream, JtwigContext context) throws RenderException { try { if (isTrue(conditionalExpression.calculate(context))) { return content.render(outputStream, context); } else { for (ElseIfExpression exp : elseIfExpressions) { if (exp.render(outputStream, context)) return true; } if (elseExpression != null) { return elseExpression.render(outputStream, context); } return true; } } catch (CalculateException e) { throw new RenderException(e); } }