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: /**
14: * This is created for repeat usages of a variable in an expression. It
15: * delegates method calls back to the original VarNode.
16: */
17: public class VarNodeProxy extends LeafNode implements VarNodeIF {
18:
19: private VarNode varNode;
20:
21: public VarNodeProxy(VarNode v) {
22: this .varNode = v;
23: }
24:
25: public Object accept(NodeVisitor visitor, Object[] results) {
26: return visitor.visitVarNode(this .varNode, results);
27: }
28:
29: public VarNode getVarNode() {
30: return varNode;
31: }
32:
33: public String toString() {
34: return super .toString() + " for " + varNode;
35: }
36:
37: public Field visit(MemVisitor visitor, Object obj) {
38: return visitor.visitVarNodeProxy(this , obj);
39: }
40:
41: public String getType() {
42: return varNode.getType();
43: }
44:
45: public String getIdentifier() {
46: return varNode.getIdentifier();
47: }
48:
49: public Class getCls() {
50: return varNode.getCls();
51: }
52:
53: public void setUsedInProjection(boolean usedInProjection) {
54: varNode.setUsedInProjection(usedInProjection);
55: }
56:
57: public boolean isUsedInProjection() {
58: return varNode.isUsedInProjection();
59: }
60:
61: public Object arrive(NodeVisitor v, Object msg) {
62: return v.arriveVarNodeProxy(this, msg);
63: }
64:
65: }
|