1 21 package oracle.toplink.essentials.internal.parsing; 23 24 import oracle.toplink.essentials.expressions.*; 25 26 37 public class ParameterNode extends Node { 38 39 40 private String name; 41 42 45 public ParameterNode() { 46 super(); 47 } 48 49 54 public ParameterNode(String newParameterName) { 55 setParameterName(newParameterName); 56 } 57 58 61 public void validateParameter(ParseTreeContext context, Object contextType) { 62 context.defineParameterType(name, contextType); 63 setType(context.getParameterType(name)); 64 } 65 66 67 public Expression generateExpression(GenerationContext context) { 68 Class baseClass = context.getBaseQueryClass(); 70 ExpressionBuilder builder = new ExpressionBuilder(baseClass); 71 Expression whereClause = builder.getParameter(getParameterName(), getType()); 72 return whereClause; 73 } 74 75 80 public String getAsString() { 81 return getParameterName(); 82 } 83 84 88 public String getParameterName() { 89 return name; 90 } 91 92 93 public void setParameterName(String name) { 94 this.name = name; 95 } 96 97 101 public boolean isParameterNode() { 102 return true; 103 } 104 105 } 106 | Popular Tags |