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.ejb.query;
12:
13: /**
14: * Entry in an update list.
15: */
16: public class SetNode extends Node {
17:
18: private String identifier;
19: private String fieldName;
20: private Node value;
21:
22: public SetNode(String identifier, String fieldName, Node value) {
23: this .identifier = identifier;
24: this .fieldName = fieldName;
25: this .value = value;
26: }
27:
28: public String getIdentifier() {
29: return identifier;
30: }
31:
32: public String getFieldName() {
33: return fieldName;
34: }
35:
36: public Node getValue() {
37: return value;
38: }
39:
40: public Object arrive(NodeVisitor v, Object msg) {
41: return v.arriveSetNode(this , msg);
42: }
43:
44: public String toStringImp() {
45: StringBuffer s = new StringBuffer();
46: if (identifier != null) {
47: s.append(identifier);
48: s.append('.');
49: }
50: s.append(fieldName);
51: s.append(" = ");
52: s.append(value);
53: return s.toString();
54: }
55:
56: public void resolve(ResolveContext rc) {
57: value.resolve(rc);
58: }
59:
60: }
|