ooxmldomfactory.java

来自「Java的面向对象数据库系统的源代码」· Java 代码 · 共 38 行

JAVA
38
字号
// Copyright 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// $Id: OOXMLDOMFactory.java,v 1.2 2003/11/20 23:18:42 per_nyfelt Exp $

package org.ozoneDB.xml;

import org.w3c.dom.Document;
import org.ozoneDB.xml.*;
import org.ozoneDB.*;


public class OOXMLDOMFactory extends DOMFactory {


    public static Document createDocument( Class docClass, OzoneInterface ozoneDB, String docName ) {
        try {
            // Returns the document type which is either docClass (must extend
            // Document), or the class from the properties file, or XMLDocument.
            docClass = getDocClass( docClass );

            // Instantiate a new document, report any error encountered and default
            // to XMLDocument is necessary.
            if (docClass != null && docClass != Document.class && docClass != XMLDocument.class) {
                return (Document)ozoneDB.createObject( docClass.getName(), 0, docName );
            } else {
                return (Document)ozoneDB.createObject( org.ozoneDB.xml.dom.DocumentImpl.class.getName(), 0, docName );
            }
        } catch (Exception except) {
            except.printStackTrace();
            return null;
        }
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?