1 package com.genimen.djeneric.repository.oql.core.nodes; 2 3 import java.util.HashMap ; 4 5 import com.genimen.djeneric.repository.oql.core.DjOqlParserEngine; 6 import com.genimen.djeneric.repository.oql.core.SimpleNode; 7 8 public class CharNode extends SimpleNode implements ValueExpression 9 { 10 String _value; 11 12 public CharNode(int i) 13 { 14 super(i); 15 } 16 17 public CharNode(DjOqlParserEngine p, int i) 18 { 19 super(p, i); 20 } 21 22 public String getName() 23 { 24 return toString(); 25 } 26 27 public String toString() 28 { 29 return _value; 30 } 31 32 public void setValue(String v) 33 { v = v.substring(1); 35 v = v.substring(0, v.length() - 1); 36 37 _value = String.valueOf(StringNode.translateEscapes(v).charAt(0)); 38 } 39 40 public void translate(StringBuffer result, HashMap path2AliasMapping) 41 { 42 appendOpenBrackets(result); 43 result.append("'" + _value + "'"); 44 appendCloseBrackets(result); 45 } 46 47 public Object getValue(MatchingContext context) 48 { 49 return _value; 50 } 51 52 } | Popular Tags |