📄 ozonecdataimpl.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: OzoneCDATAImpl.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.*;import org.ozoneDB.core.ObjectContainer;import org.ozoneDB.core.ObjectID;import org.ozoneDB.xml.dom4j.OzoneCDATA;import org.ozoneDB.xml.dom4j.OzoneDocumentFactory;import org.xml.sax.ContentHandler;import org.xml.sax.SAXException;/** * * @author Per Nyfelt */public class OzoneCDATAImpl extends DefaultCDATA implements OzoneCDATA, OzoneCompatible { final static long serialVersionUID = 1L; private OzoneObject ozoneObject; private void init() { ozoneObject = new OzoneObject(); } public static OzoneCDATA create(OzoneInterface db, String text) { return (OzoneCDATA) db.createObject(OzoneCDATAImpl.class, new Class[] {String.class}, new Object[]{text}); } /** @param text is the CDATA text */ public OzoneCDATAImpl(String text) { super(text); init(); } public static OzoneCDATA create(OzoneInterface db, Element parent, String text) { final Class[] signature = new Class[] {Element.class, String.class}; return (OzoneCDATA) db.createObject(OzoneCDATAImpl.class, signature, new Object[]{parent, text}); } public OzoneCDATAImpl(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 ObjectID getObjectID() { return ozoneObject.getObjectID(); } public void setContainer(ObjectContainer _container) { ozoneObject.setContainer(_container); } public ObjectContainer container() { return ozoneObject.container(); } public OzoneProxy self() { return ozoneObject.self(); } public OzoneInterface database() { return ozoneObject.database(); } public boolean toXML(ContentHandler ch) throws SAXException { return ozoneObject.toXML(ch); } public void onCreate() { } public void onActivate() { } public void onPassivate() { } public void onDelete() { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -