📄 ozonedocumenttypeimpl.java
字号:
// You can redistribute this software and/or modify it under the terms of// the Ozone Library License version 1 published by ozone-db.org.//// The original code and portions created by SMB are// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.//// $Id: OzoneDocumentTypeImpl.java,v 1.1 2003/11/02 18:10:03 per_nyfelt Exp $package org.ozoneDB.xml.dom4j.o3impl;import org.dom4j.DocumentFactory;import org.dom4j.Node;import org.dom4j.NodeFactory;import org.dom4j.XPathFactory;import org.ozoneDB.OzoneCompatible;import org.ozoneDB.OzoneInterface;import org.ozoneDB.OzoneRemoteException;import org.ozoneDB.xml.dom4j.OzoneDocumentFactory;import org.ozoneDB.xml.dom4j.OzoneDocumentType;/** * * @author Per Nyfelt */public class OzoneDocumentTypeImpl extends DefaultDocumentType implements OzoneDocumentType, OzoneCompatible { final static long serialVersionUID = 1L; private void init() { } public OzoneDocumentTypeImpl() { init(); } public static OzoneDocumentType create(OzoneInterface db) { return (OzoneDocumentType) db.createObject(OzoneDocumentTypeImpl.class); } /** <p>This will create a new <code>DocumentType</code> * with a reference to the external DTD</p> * * @param elementName is the root element name of the document type * @param systemID is the system ID of the external DTD */ public OzoneDocumentTypeImpl(String elementName, String systemID) { super(elementName, systemID); init(); } public static OzoneDocumentType create(OzoneInterface db, String elementName, String systemID) { final Class[] signature = new Class[] {String.class, String.class}; return (OzoneDocumentType) db.createObject(OzoneAttributeImpl.class, signature, new Object[]{elementName, systemID}); } /** <p>This will create a new <code>DocumentType</code> * with a reference to the external DTD</p> * * @param elementName is the root element name of the document type * @param publicID is the public ID of the DTD * @param systemID is the system ID of the DTD */ public OzoneDocumentTypeImpl(String elementName, String publicID, String systemID) { super(elementName, publicID, systemID); init(); } public static OzoneDocumentType create(OzoneInterface db, String elementName, String publicID, String systemID) { final Class[] signature = new Class[] {String.class, String.class, String.class}; return (OzoneDocumentType) db.createObject(OzoneAttributeImpl.class, signature, new Object[]{elementName, publicID, systemID}); } public DocumentFactory getDocumentFactory() { throw new OzoneRemoteException("getDocumentFactory will not work in Ozone"); } protected NodeFactory getNodeFactory() { try { // todo: might be faster to return super.getNodeFactory() if it is instanceof OzoneCompatible first // before falling back to object for name look-up return (NodeFactory) database().objectForName(OzoneDocumentFactory.OBJECT_NAME); } catch (Exception e) { throw new OzoneRemoteException("NodeFctory not registered" + e.toString()); } } protected XPathFactory getXPathFactory() { try { // todo: might be faster to return super.getXPathFactory() if it is instanceof OzoneCompatible first // before falling back to object for name look-up return (XPathFactory) database().objectForName(OzoneDocumentFactory.OBJECT_NAME); } catch (Exception e) { throw new OzoneRemoteException("XPathFactory not registered" + e.toString()); } } public Object clone() { try { Node answer = (Node) database().copyObject(self()); answer.setDocument(null); answer.setParent(null); return answer; } catch (Exception e) { e.printStackTrace(); return null; } } public void onCreate() { } public void onActivate() { } public void onPassivate() { } public void onDelete() { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -