KickJava   Java API By Example, From Geeks To Geeks.

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


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  * Package element from a .jdo file.
20  */

21 public final class JdoPackage extends JdoElement {
22
23     public String JavaDoc name;
24     public JdoClass[] classes;
25     public JdoExtension[] extensions;
26     public JdoRoot parent;
27
28     public JdoElement getParent() { return parent; }
29
30     /**
31      * Get information for this element to be used in building up a
32      * context string.
33      * @see #getContext
34      */

35     public String JavaDoc getSubContext() {
36         return "package[" + name + "]";
37     }
38
39     public String JavaDoc toString() {
40         return getSubContext();
41     }
42
43     public void dump() {
44         dump(Debug.OUT, "");
45     }
46
47     public void dump(PrintStream JavaDoc out, String JavaDoc indent) {
48         out.println(indent + this);
49         String JavaDoc is = indent + " ";
50         if (classes != null) {
51             for (int i = 0; i < classes.length; i++) {
52                 classes[i].dump(out, is);
53             }
54         }
55         if (extensions != null) {
56             for (int i = 0; i < extensions.length; i++) {
57                 extensions[i].dump(out, is);
58             }
59         }
60     }
61
62 }
63
64
Popular Tags