1 package com.genimen.djeneric.repository.oql.core.nodes; 2 3 import java.util.ArrayList ; 4 import java.util.HashMap ; 5 6 import com.genimen.djeneric.repository.oql.core.DjOqlParserEngine; 7 import com.genimen.djeneric.repository.oql.core.SimpleNode; 8 9 public class ParameterNode extends SimpleNode implements ValueExpression 10 { 11 private String _paramName; 12 13 public ParameterNode(int i) 14 { 15 super(i); 16 } 17 18 public ParameterNode(DjOqlParserEngine p, int i) 19 { 20 super(p, i); 21 } 22 23 public String getName() 24 { 25 return toString(); 26 } 27 28 public String toString() 29 { 30 return _paramName; 31 } 32 33 public void translate(StringBuffer result, HashMap path2AliasMapping) 34 { 35 appendOpenBrackets(result); 36 result.append(":"); 37 result.append(_paramName); 38 appendCloseBrackets(result); 39 } 40 41 public String getParamName() 42 { 43 return _paramName; 44 } 45 46 public void setParamName(String string) 47 { 48 _paramName = string; 49 } 50 51 public void collectParameters(ArrayList parameters) 52 { 53 parameters.add(_paramName); 54 } 55 56 public Object getValue(MatchingContext context) 57 { 58 return context.getParamater(_paramName); 59 } 60 61 } | Popular Tags |