1 61 62 63 64 package org.jaxen.expr; 65 66 import org.jaxen.Context; 67 68 class DefaultLiteralExpr extends DefaultExpr implements LiteralExpr 69 { 70 private String literal; 71 72 DefaultLiteralExpr(String literal) 73 { 74 this.literal = literal; 75 } 76 77 public String getLiteral() 78 { 79 return this.literal; 80 } 81 82 public String toString() 83 { 84 return "[(DefaultLiteralExpr): " + getLiteral() + "]"; 85 } 86 87 public String getText() 88 { 89 return "\"" + getLiteral() + "\""; 90 } 91 92 public Object evaluate(Context context) 93 { 94 return getLiteral(); 95 } 96 97 public void accept(Visitor visitor) 98 { 99 visitor.visit(this); 100 } 101 } 102 | Popular Tags |