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

📄 ozonexpathquery.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: OzoneXPathQuery.java,v 1.1 2003/11/02 17:26:15 per_nyfelt Exp $package org.ozoneDB.xml.util;import java.io.*;import org.w3c.dom.Node;import org.w3c.dom.traversal.NodeFilter;import org.infozone.tools.xml.queries.XObject;import org.infozone.tools.xml.queries.XPathQuery;/** * This class represents a XPath that can be used to query the document of * a {@link XMLContainer}. * * @version $Revision: 1.1 $ $Date: 2003/11/02 17:26:15 $ * @author <a href="http://www.softwarebuero.de">SMB</a> * @see XMLContainer */public final class OzoneXPathQuery implements XPathQuery, Externalizable {    protected final static long serialVersionUID = 1L;    protected String qstring;    protected NodeFilter filter;    protected Node namespace;    protected Node rootNode;    protected transient XMLContainer delegate;    public OzoneXPathQuery() {    }    protected OzoneXPathQuery(XMLContainer _delegate) {        delegate = _delegate;    }    public void setQString(String _qstring) throws Exception {        qstring = _qstring;    }    public void setNamespace(Node _namespace) throws Exception {        namespace = _namespace;    }    public void setNodeFilter(NodeFilter _filter) throws Exception {        filter = _filter;    }    /**     * Execute the xpath.     *     * @see #execute(Node)     */    public XObject execute() throws Exception {        return execute(null);    }    /**     * Execute the xpath.     *     * @param _rootNode The node from which the query should start. A value of     *     null specifies that the entire document should be searched.     * @return The XObject insulating the query result.     */    public XObject execute(Node _rootNode) throws Exception {        rootNode = _rootNode;        return delegate.executeXPath(this);    }    public void writeExternal(ObjectOutput out) throws IOException {        out.writeObject(rootNode);        out.writeObject(qstring);        out.writeObject(filter);        out.writeObject(namespace);    }    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {        rootNode = (Node) in.readObject();        qstring = (String) in.readObject();        filter = (NodeFilter) in.readObject();        namespace = (Node) in.readObject();    }}

⌨️ 快捷键说明

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