01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Core License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: TestXML2Object.java,v 1.1 2001/12/18 10:31:31 per_nyfelt Exp $
08:
09: package org.ozoneDB.core.xml;
10:
11: import java.io.*;
12: import org.xml.sax.*;
13: import org.apache.xerces.parsers.SAXParser;
14:
15: import java.util.Stack;
16: import java.util.Hashtable;
17:
18: /**
19: * This class is for testing Object2XML.
20: *
21: * @version $Revision: 1.1 $
22: * @author <a href="http://www.softwarebuero.de">SMB</a>
23: */
24: public class TestXML2Object implements XML2ObjectDelegate {
25:
26: public TestXML2Object() {
27: }
28:
29: public static void main(String[] args) throws Exception {
30: FileInputStream istream = new FileInputStream("ausgabe.xml");
31: InputStream instream = istream;
32:
33: ContentHandler contentHandler = new XML2ObjectContentHandler(
34: new TestXML2Object());
35: long start = System.currentTimeMillis();
36:
37: XMLReader parser = new SAXParser();
38: parser.setContentHandler(contentHandler);
39: parser.parse(new InputSource(instream));
40:
41: long end = System.currentTimeMillis();
42: System.out.println("Zeit: " + (end - start));
43: }
44:
45: public void handleObject(ObjElement oe) {
46: System.out.println(oe.getObject().toString());
47: System.out.println("Name... " + oe.getClassName());
48: System.out.println("ID..... " + oe.getId());
49: System.out.println("OOName. " + oe.getOzoneObjectName());
50: System.out.println("OOId... " + oe.getOzoneObjectId());
51: }
52: }
|