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