KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > repository > oql > core > nodes > ParameterNode


1 package com.genimen.djeneric.repository.oql.core.nodes;
2
3 import java.util.ArrayList JavaDoc;
4 import java.util.HashMap JavaDoc;
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 JavaDoc _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 JavaDoc getName()
24   {
25     return toString();
26   }
27
28   public String JavaDoc toString()
29   {
30     return _paramName;
31   }
32
33   public void translate(StringBuffer JavaDoc result, HashMap JavaDoc path2AliasMapping)
34   {
35     appendOpenBrackets(result);
36     result.append(":");
37     result.append(_paramName);
38     appendCloseBrackets(result);
39   }
40
41   public String JavaDoc getParamName()
42   {
43     return _paramName;
44   }
45
46   public void setParamName(String JavaDoc string)
47   {
48     _paramName = string;
49   }
50
51   public void collectParameters(ArrayList JavaDoc parameters)
52   {
53     parameters.add(_paramName);
54   }
55
56   public Object JavaDoc getValue(MatchingContext context)
57   {
58     return context.getParamater(_paramName);
59   }
60
61 }
Popular Tags