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:
16: package org.griphyn.vdl.parser;
17:
18: import org.griphyn.vdl.dax.*;
19: import org.griphyn.vdl.util.*;
20: import java.io.*;
21:
22: /**
23: * This class is used to test the <code>DAXParser</code> class and
24: * the input file index. It parses all the DAX documents specified
25: * in the commandline, creates the corresponding java objects, and
26: * generates an XML document from these objects. It also prints
27: * the input file list if the last definition in the document is
28: * a derivation.
29: *
30: * @author Jens-S. Vöckler
31: * @author Yong Zhao
32: * @version $Revision: 50 $
33: *
34: * @see DAXParser
35: * @see org.griphyn.vdl.dax.ADAG
36: */
37:
38: public class DAXTest {
39: static public void main(String[] args) throws IOException {
40: if (args.length == 0) {
41: System.err.println("Usage: java Test [daxURI] ...");
42: return;
43: }
44: // connect debug stream
45: Logging.instance().register("DAXparser", System.err);
46: Logging.instance().register("app", System.err);
47:
48: DAXParser daxParser = new DAXParser(System
49: .getProperty("vds.schema.dax"));
50: Writer stdout = new BufferedWriter(new OutputStreamWriter(
51: System.out));
52: for (int i = 0; i < args.length; i++) {
53: ADAG adag = daxParser.parse(args[i]);
54: adag.toXML(stdout, "", null);
55: Logging.instance().log("app", 0, "done writing XML");
56: }
57: }
58: }
|