⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ozonecommentimpl.java

📁 Java的面向对象数据库系统的源代码
💻 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: OzoneCommentImpl.java,v 1.1 2003/11/02 18:10:03 per_nyfelt Exp $package org.ozoneDB.xml.dom4j.o3impl;import org.dom4j.*;import org.ozoneDB.OzoneCompatible;import org.ozoneDB.OzoneInterface;import org.ozoneDB.OzoneRemoteException;import org.ozoneDB.xml.dom4j.OzoneComment;import org.ozoneDB.xml.dom4j.OzoneDocumentFactory;/** * * @author Per Nyfelt */public class OzoneCommentImpl extends DefaultComment implements OzoneComment, OzoneCompatible {    final static long serialVersionUID = 1L;    private void init() {    }    public static OzoneComment create(OzoneInterface db, String text) {        return (OzoneComment) db                .createObject(OzoneCommentImpl.class,                        new Class[] {String.class},                        new Object[]{text});    }    /** @param text is the Comment text     */    public OzoneCommentImpl(String text) {        super(text);        init();    }    public static OzoneComment create(OzoneInterface db, Element parent, String text) {        Class[] signature = new Class[] {Element.class, String.class};        return (OzoneComment) db                .createObject(OzoneCommentImpl.class,                        signature,                        new Object[]{parent, text});    }    /** @param parent is the parent element     * @param text is the Comment text     */    public OzoneCommentImpl(Element parent, String text) {        super(parent, text);        init();    }    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 + -