1 52 53 package freemarker.core; 54 55 import freemarker.template.TemplateException; 56 57 final class OrExpression extends BooleanExpression { 58 59 private final Expression left; 60 private final Expression right; 61 62 OrExpression(Expression left, Expression right) { 63 this.left = left; 64 this.right = right; 65 } 66 67 boolean isTrue(Environment env) throws TemplateException { 68 return left.isTrue(env) || right.isTrue(env); 69 } 70 71 public String getCanonicalForm() { 72 return left.getCanonicalForm() + " || " + right.getCanonicalForm(); 73 } 74 75 boolean isLiteral() { 76 return constantValue !=null || (left.isLiteral() && right.isLiteral()); 77 } 78 79 Expression _deepClone(String name, Expression subst) { 80 return new OrExpression(left.deepClone(name, subst), right.deepClone(name, subst)); 81 } 82 } 83 | Popular Tags |