KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > metadata > parser > JdoRoot


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.metadata.parser;
13
14 import com.versant.core.common.Debug;
15
16 import java.io.PrintStream JavaDoc;
17
18 /**
19  * Root element of a .jdo file.
20  */

21 public final class JdoRoot extends JdoElement {
22
23     public String JavaDoc name;
24     public JdoPackage[] packages;
25
26     public JdoElement getParent() { return null; }
27
28     public String JavaDoc getSubContext() {
29         return name;
30     }
31
32     public String JavaDoc toString() {
33         return getSubContext();
34     }
35
36     /**
37      * Does this file contain only meta data for queries?
38      */

39     public boolean isQueryMetaData() {
40         return name.endsWith(".jdoquery");
41     }
42
43     public void dump() {
44         dump(Debug.OUT);
45     }
46
47     public void dump(PrintStream JavaDoc out) {
48         out.println(this);
49         for (int i = 0; i < packages.length; i++) {
50             packages[i].dump(out, " ");
51         }
52     }
53
54 }
55
Popular Tags