1 16 package org.apache.commons.jelly.expression; 17 18 import org.apache.commons.jelly.JellyContext; 19 20 27 public class ConstantExpression extends ExpressionSupport { 28 29 30 private Object value; 31 32 34 public ConstantExpression() { 35 } 36 37 39 public ConstantExpression(Object value) { 40 this.value = value; 41 } 42 43 public String toString() { 44 return super.toString() + "[value=" + value +"]"; 45 } 46 47 public String getExpressionText() { 48 return value == null ? "null" : value.toString(); 49 } 50 51 57 public Object evaluate(JellyContext context) { 58 return value; 59 } 60 61 62 public Object getValue() { 63 return value; 64 } 65 66 67 public void setValue(Object value) { 68 this.value = value; 69 } 70 } 71 | Popular Tags |