01: /*
02: * This file or a portion of this file is licensed under the terms of
03: * the Globus Toolkit Public License, found in file ../GTPL, or at
04: * http://www.globus.org/toolkit/download/license.html. This notice must
05: * appear in redistributions of this file, with or without modification.
06: *
07: * Redistributions of this Software, with or without modification, must
08: * reproduce the GTPL in: (1) the Software, or (2) the Documentation or
09: * some other similar material which is provided with the Software (if
10: * any).
11: *
12: * Copyright 1999-2004 University of Chicago and The University of
13: * Southern California. All rights reserved.
14: */
15: package org.griphyn.vdl.dax;
16:
17: import java.io.Writer;
18: import java.io.IOException;
19:
20: /**
21: * <code>Leaf</code> is an abstract base class for leaf nodes in the
22: * instance tree.
23: *
24: * @author Jens-S. Vöckler
25: * @author Yong Zhao
26: * @version $Revision: 50 $
27: *
28: * @see PseudoText
29: * @see Filename
30: */
31: public abstract class Leaf extends DAX implements Cloneable {
32: /**
33: * Creates and returns a copy of this object.
34: * @return a new instance.
35: */
36: public abstract Object clone();
37:
38: /**
39: * Dumps the state of the filename as PlainFilenameType without the
40: * transiency information. Other leaves will use their regular toXML
41: * method.
42: *
43: * @param indent is a <code>String</code> of spaces used for pretty
44: * printing. The initial amount of spaces should be an empty string.
45: * The parameter is used internally for the recursive traversal.
46: * @param namespace is the XML schema namespace prefix. If neither
47: * empty nor null, each element will be prefixed with this prefix,
48: * and the root element will map the XML namespace.
49: * @param flag if bit#0 is set, also dump the linkage information,
50: * otherwise do not dump linkage information. If bit#1 is set, also
51: * dump optionality for true optional files. Unused in base class.
52: * @return a String which contains the state of the current class
53: * and its siblings using XML. Note that these strings might become large.
54: *
55: * @see #toXML( String, String )
56: */
57: public String shortXML(String indent, String namespace, int flag) {
58: return toXML(indent, namespace);
59: }
60:
61: /**
62: * Dumps the state of the filename as PlainFilenameType without the
63: * transiency information. Other leaves will use their regular toXML
64: * method.
65: *
66: * @param stream is a stream opened and ready for writing. This can also
67: * be a string stream for efficient output.
68: * @param indent is a <code>String</code> of spaces used for pretty
69: * printing. The initial amount of spaces should be an empty string.
70: * The parameter is used internally for the recursive traversal.
71: * @param namespace is the XML schema namespace prefix. If neither
72: * empty nor null, each element will be prefixed with this prefix,
73: * and the root element will map the XML namespace.
74: * @param flag if bit#0 is set, also dump the linkage information,
75: * otherwise do not dump linkage information. If bit#1 is set, also
76: * dump optionality for true optional files. Unused in base class.
77: * @exception IOException if something fishy happens to the stream.
78: *
79: * @see #toXML( Writer, String, String )
80: */
81: public void shortXML(Writer stream, String indent,
82: String namespace, int flag) throws IOException {
83: toXML(stream, indent, namespace);
84: }
85: }
|