1 61 62 63 64 package org.jaxen.expr; 65 66 import org.jaxen.Context; 67 import org.jaxen.JaxenException; 68 69 class DefaultPredicate implements Predicate 70 { 71 private Expr expr; 72 73 DefaultPredicate(Expr expr) 74 { 75 setExpr( expr ); 76 } 77 78 public Expr getExpr() 79 { 80 return this.expr; 81 } 82 83 public void setExpr(Expr expr) 84 { 85 this.expr = expr; 86 } 87 88 public String getText() 89 { 90 return "[" + getExpr().getText() + "]"; 91 } 92 93 public String toString() 94 { 95 return "[(DefaultPredicate): " + getExpr() + "]"; 96 } 97 98 public void simplify() 99 { 100 setExpr( getExpr().simplify() ); 101 } 102 103 public Object evaluate(Context context) throws JaxenException 104 { 105 return getExpr().evaluate( context ); 106 } 107 public void accept(Visitor visitor) 108 { 109 visitor.visit(this); 110 } 111 } 112 | Popular Tags |