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.metadata.parser;
12:
13: import com.versant.core.common.Debug;
14:
15: import java.io.PrintStream;
16:
17: /**
18: * Root element of a .jdo file.
19: */
20: public final class JdoRoot extends JdoElement {
21:
22: public String name;
23: public JdoPackage[] packages;
24:
25: public JdoElement getParent() {
26: return null;
27: }
28:
29: public String getSubContext() {
30: return name;
31: }
32:
33: public String toString() {
34: return getSubContext();
35: }
36:
37: /**
38: * Does this file contain only meta data for queries?
39: */
40: public boolean isQueryMetaData() {
41: return name.endsWith(".jdoquery");
42: }
43:
44: public void dump() {
45: dump(Debug.OUT);
46: }
47:
48: public void dump(PrintStream out) {
49: out.println(this );
50: for (int i = 0; i < packages.length; i++) {
51: packages[i].dump(out, " ");
52: }
53: }
54:
55: }
|