public class WatchManager extends ProxyReceiver implements NamespaceResolver
A Watch is not itself a receiver, but it can nominate a Receiver to receive all events while it is active. It will stop receiving events when it is deactivated.
| Modifier and Type | Field and Description |
|---|---|
protected Stack<List<com.saxonica.stream.watch.WatchManager.ClosedownAction>> |
activeWatchStack |
protected int |
elementStackTop |
protected List<Watch> |
watchList |
nextReceiverpipelineConfiguration, previousAtomic, systemIdPI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING| Constructor and Description |
|---|
WatchManager(Receiver next)
Create a WatchManager
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPrearrangedWatches() |
void |
addWatch(Watch watch)
Add a new Watch.
|
void |
attribute(NodeName nameCode,
SimpleType typeCode,
CharSequence value,
int locationId,
int properties)
Notify an attribute
|
void |
characters(CharSequence chars,
int locationId,
int properties)
Text node
|
void |
comment(CharSequence chars,
int 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() |
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,
int locationId,
int properties)
Processing Instruction
|
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,
int locationId,
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, close, getNamePool, getUnderlyingReceiver, open, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntityappend, getConfiguration, getPipelineConfiguration, getSystemIdpublic WatchManager(Receiver next)
next - the receiver that is next in the pipeline for receiving eventspublic void setStartTagBuffer(StartTagBuffer stb)
public void setXPathContext(XPathContext context)
public XPathContext getXPathContext()
public void startDocument(int properties)
throws XPathException
startDocument in interface ReceiverstartDocument in class ProxyReceiverproperties - 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, int locationId, int properties) throws XPathException
startElement in interface ReceiverstartElement in class ProxyReceiverelementName - integer code identifying the name of the element within the name pool.typeCode - integer code identifying the element's type within the name pool.locationId - an integer which can be interpreted using a LocationProvider to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties - properties of the element nodeXPathException - if an error occursprotected void addPrearrangedWatches()
throws XPathException
XPathExceptionpublic void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, int locationId, int properties) throws XPathException
attribute in interface Receiverattribute in class ProxyReceivernameCode - integer identifying the name of the attributetypeCode - integer identifying the type annotation (ignored)value - the value of the attributeproperties - additional properties of the attributelocationId - an integer which can be interpreted using a LocationProvider to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.XPathException - On any failure to write the attributepublic void namespace(NamespaceBinding namespaceBinding, int properties) throws XPathException
namespace in interface Receivernamespace in class ProxyReceivernamespaceBinding - the prefix/uri pair being notifiedproperties - properties of this eventXPathException - if any error occurspublic void characters(CharSequence chars, int locationId, int properties) throws XPathException
characters in interface Receivercharacters in class ProxyReceiverchars - The characterslocationId - an integer which can be interpreted using a LocationProvider
to return information such as line number and system ID. If no location information is available,
the value zero is supplied.properties - Bit significant value. The following bits are defined:
XPathException - if an error occurspublic void endElement()
throws XPathException
endElement in interface ReceiverendElement in class ProxyReceiverXPathException - if an error occurspublic void endDocument()
throws XPathException
endDocument in interface ReceiverendDocument in class ProxyReceiverXPathException - if an error occurspublic void comment(CharSequence chars, int locationId, int properties) throws XPathException
comment in interface Receivercomment in class ProxyReceiverchars - The content of the commentlocationId - an integer which can be interpreted using a LocationProvider to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties - Additional information about the comment.XPathException - if an error occurspublic void processingInstruction(String target, CharSequence data, int locationId, int properties) throws XPathException
processingInstruction in interface ReceiverprocessingInstruction in class ProxyReceivertarget - The PI name. This must be a legal name (it will not be checked).data - The data portion of the processing instructionlocationId - an integer which can be interpreted using a LocationProvider to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties - Additional information about the PI.XPathException - if an error occurspublic void startContent()
throws XPathException
startContent in interface ReceiverstartContent in class ProxyReceiverXPathExceptionpublic void addWatch(Watch watch) throws XPathException
watch - the watch to be addedXPathException - if any error occurspublic 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 ReceiverusesTypeAnnotations in class ProxyReceiverpublic FleetingDocumentNode getDocumentNode()
public Map<Accumulator,AccumulatorWatch> getAccumulatorWatchMap()
public void setAccumulatorWatchMap(Map<Accumulator,AccumulatorWatch> accumulatorWatchMap)
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.