public class WatchManager extends SequenceReceiver implements NamespaceResolver
| Modifier and Type | Field and Description |
|---|---|
protected Stack<List<com.saxonica.ee.stream.watch.WatchManager.ClosedownAction>> |
activeWatchStack |
protected int |
elementStackTop |
protected List<Watch> |
watchList |
pipelineConfiguration, previousAtomic, systemIdPI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING| Constructor and Description |
|---|
WatchManager(PipelineConfiguration pipe)
Create a WatchManager
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPrearrangedWatches() |
void |
addWatch(Watch watch)
Add a new Watch.
|
void |
append(Item item,
Location locationId,
int copyNamespaces)
Append an arbitrary item (node or atomic value) to the output
|
void |
attribute(NodeName nameCode,
SimpleType typeCode,
CharSequence value,
Location locationId,
int properties)
Notify an attribute
|
void |
characters(CharSequence chars,
Location locationId,
int properties)
Text node
|
void |
close()
Notify the end of the event stream
|
void |
comment(CharSequence chars,
Location locationId,
int properties)
Output a comment
|
void |
endDocument()
Notify the end of a document node
|
void |
endElement()
Notify end of element
|
Map<Accumulator,AccumulatorWatch> |
getAccumulatorWatchMap()
Get a map from accumulators to AccumulatorWatch instances
|
FleetingDocumentNode |
getDocumentNode() |
String |
getURIForPrefix(String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix.
|
XPathContext |
getXPathContext() |
Iterator<String> |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
void |
namespace(NamespaceBinding namespaceBinding,
int properties)
Notify a namespace
|
void |
processingInstruction(String target,
CharSequence data,
Location locationId,
int properties)
Processing Instruction
|
void |
removeWatch(Watch watch)
Remove a watch
|
void |
setAccumulatorWatchMap(Map<Accumulator,AccumulatorWatch> accumulatorWatchMap) |
void |
setStartTagBuffer(StartTagBuffer stb) |
void |
setXPathContext(XPathContext context) |
void |
startContent()
Start element content (called after all the attributes and namespaces have been processed)
|
void |
startDocument(int properties)
Start of a document node.
|
void |
startElement(NodeName elementName,
SchemaType typeCode,
Location location,
int properties)
Output element start tag
|
boolean |
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events
|
append, getConfiguration, getNamePool, getPipelineConfiguration, getSystemId, isTrueSequenceReceiver, open, setPipelineConfiguration, setSystemId, setUnparsedEntitypublic WatchManager(PipelineConfiguration pipe)
pipe - the pipeline configurationpublic void setStartTagBuffer(StartTagBuffer stb)
public void setXPathContext(XPathContext context)
public XPathContext getXPathContext()
public void append(Item item, Location locationId, int copyNamespaces) throws XPathException
append in class SequenceReceiveritem - the item to be appendedlocationId - the location of the calling instruction, for diagnosticscopyNamespaces - if the item is an element node, this indicates whether its namespaces
need to be copied. Values are NodeInfo.ALL_NAMESPACES,
NodeInfo.LOCAL_NAMESPACES, NodeInfo.NO_NAMESPACESXPathException - if the operation failspublic void close()
throws XPathException
close in interface ReceiverXPathException - if an error occurspublic void startDocument(int properties)
throws XPathException
startDocument in interface Receiverproperties - bit-significant integer indicating properties of the document node.
The definitions of the bits are in class ReceiverOptionsXPathException - if an error occurspublic void startElement(NodeName elementName, SchemaType typeCode, Location location, int properties) throws XPathException
startElement in interface ReceiverelementName - the name of the element.typeCode - the type annotation of the element.location - an object providing information about the module, line, and column where the node originatedproperties - bit-significant properties of the element node. If there are no revelant
properties, zero is supplied. The definitions of the bits are in class ReceiverOptionsXPathException - if an error occursprotected void addPrearrangedWatches()
throws XPathException
XPathExceptionpublic void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, Location locationId, int properties) throws XPathException
attribute in interface ReceivernameCode - integer identifying the name of the attributetypeCode - integer identifying the type annotation (ignored)value - the value of the attributelocationId - properties - additional properties of the attribute @throws net.sf.saxon.trans.XPathException
On any failure to write the attributeXPathException - if an error occurspublic void namespace(NamespaceBinding namespaceBinding, int properties) throws XPathException
namespace in interface ReceivernamespaceBinding - the prefix/uri pair being notifiedproperties - properties of this eventXPathException - if any error occurspublic void characters(CharSequence chars, Location locationId, int properties) throws XPathException
characters in interface Receiverchars - The characterslocationId - provides information such as line number and system ID.properties - Bit significant value. The following bits are defined:
XPathException - if an error occurspublic void endElement()
throws XPathException
endElement in interface ReceiverXPathException - if an error occurspublic void endDocument()
throws XPathException
endDocument in interface ReceiverXPathException - if an error occurspublic void comment(CharSequence chars, Location locationId, int properties) throws XPathException
comment in interface Receiverchars - The content of the commentlocationId - provides information such as line number and system ID.properties - Additional information about the comment.XPathException - if an error occurspublic void processingInstruction(String target, CharSequence data, Location locationId, int properties) throws XPathException
processingInstruction in interface Receivertarget - The PI name. This must be a legal name (it will not be checked).data - The data portion of the processing instructionlocationId - provides information such as line number and system ID.properties - Additional information about the PI.XPathException - if an error occurspublic void startContent()
throws XPathException
startContent in interface ReceiverXPathExceptionpublic void addWatch(Watch watch) throws XPathException
watch - the watch to be addedXPathException - if any error occurspublic void removeWatch(Watch watch)
watch - the watch to be removed. No error occurs if the watch is unknown or inactive.public String getURIForPrefix(String prefix, boolean useDefault)
getURIForPrefix in interface NamespaceResolverprefix - the namespace prefix. May be the zero-length string, indicating
that there is no prefix. This indicates either the default namespace or the
null namespace, depending on the value of useDefault.useDefault - true if the default namespace is to be used when the
prefix is "". If false, the method returns "" when the prefix is "".public Iterator<String> iteratePrefixes()
NamespaceResolveriteratePrefixes in interface NamespaceResolverpublic boolean usesTypeAnnotations()
usesTypeAnnotations in interface Receiverpublic FleetingDocumentNode getDocumentNode()
public Map<Accumulator,AccumulatorWatch> getAccumulatorWatchMap()
public void setAccumulatorWatchMap(Map<Accumulator,AccumulatorWatch> accumulatorWatchMap)
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.