01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdo.query;
12:
13: import com.versant.core.metadata.ClassMetaData;
14:
15: /**
16: * This is created for repeat usages of a parameter in an expression. It
17: * delegates method calls back to the original ParamNode.
18: */
19: public class ParamNodeProxy extends LeafNode {
20:
21: private ParamNode paramNode;
22:
23: public ParamNodeProxy(ParamNode p) {
24: this .paramNode = p;
25: }
26:
27: public Object accept(NodeVisitor visitor, Object[] results) {
28: return visitor.visitParamNode(this .paramNode, results);
29: }
30:
31: public ParamNode getParamNode() {
32: return paramNode;
33: }
34:
35: public String toString() {
36: return super .toString() + " for " + paramNode;
37: }
38:
39: public Field visit(MemVisitor visitor, Object obj) {
40: return visitor.visitParamNodeProxy(this , obj);
41: }
42:
43: public String getType() {
44: return paramNode.getType();
45: }
46:
47: public String getIdentifier() {
48: return paramNode.getIdentifier();
49: }
50:
51: public Class getCls() {
52: return paramNode.getCls();
53: }
54:
55: public ClassMetaData getCmd() {
56: return paramNode.getCmd();
57: }
58:
59: public Object getValue() {
60: return paramNode.getValue();
61: }
62:
63: public int getIndex() {
64: return paramNode.getIndex();
65: }
66:
67: public Object arrive(NodeVisitor v, Object msg) {
68: return v.arriveParamNodeProxy(this, msg);
69: }
70:
71: }
|