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: * NEW constructor_name(arg, ... arg).
15: */
16: public class ConstructorNode extends Node {
17:
18: private String name;
19: private Node argsList;
20:
21: public ConstructorNode(String name, Node argsList) {
22: this .name = name;
23: this .argsList = argsList;
24: }
25:
26: public String getName() {
27: return name;
28: }
29:
30: public Node getArgsList() {
31: return argsList;
32: }
33:
34: public Object arrive(NodeVisitor v, Object msg) {
35: return v.arriveConstructorNode(this , msg);
36: }
37:
38: public String toStringImp() {
39: StringBuffer s = new StringBuffer();
40: s.append("NEW ");
41: s.append(name);
42: s.append('(');
43: s.append(argsList);
44: for (Node e = argsList.getNext(); e != null; e = e.getNext()) {
45: s.append(", ");
46: s.append(e);
47: }
48: s.append(')');
49: return s.toString();
50: }
51:
52: public void resolve(ResolveContext rc) {
53: resolve(argsList, rc);
54: }
55:
56: }
|