KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > ejb > query > ConstructorNode


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.ejb.query;
13
14 /**
15  * NEW constructor_name(arg, ... arg).
16  */

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