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.common.Debug;
14:
15: /**
16: * An import declaration for a query.
17: */
18: public class ImportNode extends LeafNode {
19:
20: public String name;
21: public boolean all;
22:
23: public ImportNode() {
24: }
25:
26: public String toString() {
27: return super .toString() + ": " + name + (all ? "*" : "");
28: }
29:
30: public Field visit(MemVisitor visitor, Object obj) {
31: return visitor.visitImportNode(this , obj);
32: }
33:
34: public void dump(String indent) {
35: Debug.OUT.println(indent + this );
36: }
37:
38: public String getClassName() {
39: if (all)
40: return null;
41: int i = name.lastIndexOf('.');
42: if (i >= 0)
43: return name.substring(i + 1);
44: return name;
45: }
46:
47: public Object arrive(NodeVisitor v, Object msg) {
48: return v.arriveImportNode(this, msg);
49: }
50:
51: }
|