1 2 12 package com.versant.core.jdo.query; 13 14 import com.versant.core.metadata.ClassMetaData; 15 import com.versant.core.common.Debug; 16 17 21 public class ParamNode extends LeafNode { 22 23 private String type; 24 private String identifier; 25 private Class cls; 26 private ClassMetaData cmd; 27 private Object value; 28 31 private int index; 32 33 36 public Object usageList; 37 38 public ParamNode() { 39 } 40 41 public Object accept(NodeVisitor visitor, Object [] results) { 42 return visitor.visitParamNode(this, results); 43 } 44 45 public String toString() { 46 StringBuffer s = new StringBuffer (); 47 s.append(super.toString()); 48 s.append(' '); 49 if (cls != null) s.append(cls); 50 else s.append(type); 51 s.append(' '); 52 s.append(identifier); 53 s.append(" index "); 54 s.append(index); 55 return s.toString(); 56 } 57 58 62 public void resolve(QueryParser comp, ClassMetaData cmd, boolean ordering) { 63 if (Debug.DEBUG) System.out.println("### ParamNode.resolve " + this); 64 if (cls == null) cls = comp.resolveParamType(type); 65 } 66 67 public Field visit(MemVisitor visitor, Object obj) { 68 return visitor.visitParamNode(this, obj); 69 } 70 71 public String getType() { 72 return type; 73 } 74 75 public void setType(String type) { 76 this.type = type; 77 } 78 79 public String getIdentifier() { 80 return identifier; 81 } 82 83 public void setIdentifier(String identifier) { 84 this.identifier = identifier; 85 } 86 87 public Class getCls() { 88 return cls; 89 } 90 91 public void setCls(Class cls) { 92 this.cls = cls; 93 } 94 95 public ClassMetaData getCmd() { 96 return cmd; 97 } 98 99 public void setCmd(ClassMetaData cmd) { 100 this.cmd = cmd; 101 } 102 103 public Object getValue() { 104 return value; 105 } 106 107 public void setValue(Object value) { 108 this.value = value; 109 } 110 111 public int getIndex() { 112 return index; 113 } 114 115 public void setIndex(int index) { 116 this.index = index; 117 } 118 119 public Object getUsageList() { 120 return usageList; 121 } 122 123 public void clearSqlUsageList() { 124 usageList = null; 125 } 126 127 public Object arrive(NodeVisitor v, Object msg) { 128 return v.arriveParamNode(this, msg); 129 } 130 131 } 132 | Popular Tags |