![Stefano Mazzocchi](/assets/img/avatar_default.png)
git-svn-id: http://google-refine.googlecode.com/svn/branches/split-refactor@905 7d457c2a-affb-35e4-300a-418c747d4874
27 lines
620 B
Java
27 lines
620 B
Java
package com.metaweb.gridworks.gel.ast;
|
|
|
|
import java.util.Properties;
|
|
|
|
import org.json.JSONObject;
|
|
|
|
import com.metaweb.gridworks.expr.Evaluable;
|
|
|
|
/**
|
|
* An abstract syntax tree node encapsulating a literal value.
|
|
*/
|
|
public class LiteralExpr implements Evaluable {
|
|
final protected Object _value;
|
|
|
|
public LiteralExpr(Object value) {
|
|
_value = value;
|
|
}
|
|
|
|
public Object evaluate(Properties bindings) {
|
|
return _value;
|
|
}
|
|
|
|
public String toString() {
|
|
return _value instanceof String ? JSONObject.quote((String) _value) : _value.toString();
|
|
}
|
|
}
|