net.sf.saxon.event.BuilderMonitor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of saxon-he Show documentation
Show all versions of saxon-he Show documentation
An OSGi bundle for Saxon-HE
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2013 Saxonica Limited.
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
package net.sf.saxon.event;
import net.sf.saxon.om.NodeInfo;
/**
* A BuilderMonitor can be inserted into a pipeline immediately in front of a Builder. During tree construction,
* the method markNextNode() can be called to request that the next node to be created is treated specially by
* remembering the current position on the tree; on completion of the tree construction, the method getMarkedNode()
* can be called to return the NodeInfo that was created immediately after calling markNextNode().
*/
public abstract class BuilderMonitor extends ProxyReceiver {
public BuilderMonitor(Receiver next) {
super(next);
}
/**
* Indicate that the next node to be created will be of a given type, and request the monitor to remember
* the identity of this node.
* @param nodeKind the kind of node that will be created next
*/
public abstract void markNextNode(int nodeKind);
/**
* On completion of tree building, get the node that was marked using markNextNode().
* @return the marked node, or null if none was marked
*/
public abstract NodeInfo getMarkedNode();
}