01: // Copyright 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
02: //
03: // You can redistribute this software and/or modify it under the terms of
04: // the Ozone Library License version 1 published by softwarebuero m&b (SMB).
05: //
06: // $Id: OOXMLDOMFactory.java,v 1.1 2001/12/18 11:03:24 per_nyfelt Exp $
07:
08: package org.ozoneDB.xml;
09:
10: import org.w3c.dom.Document;
11: import org.ozoneDB.xml.dom.*;
12: import org.ozoneDB.xml.*;
13: import org.ozoneDB.*;
14:
15: public class OOXMLDOMFactory extends DOMFactory {
16:
17: public static Document createDocument(Class docClass,
18: OzoneInterface ozoneDB, String docName) {
19: try {
20: // Returns the document type which is either docClass (must extend
21: // Document), or the class from the properties file, or XMLDocument.
22: docClass = getDocClass(docClass);
23:
24: // Instantiate a new document, report any error encountered and default
25: // to XMLDocument is necessary.
26: if (docClass != null && docClass != Document.class
27: && docClass != XMLDocument.class) {
28: return (Document) ozoneDB.createObject(docClass
29: .getName(), 0, docName);
30: } else {
31: return (Document) ozoneDB.createObject(
32: org.ozoneDB.xml.dom.DocumentImpl.class
33: .getName(), 0, docName);
34: }
35: } catch (Exception except) {
36: except.printStackTrace();
37: return (Document) null;
38: }
39: }
40:
41: }
|