public class WatchManager extends SequenceReceiver implements NamespaceResolver
Modifier and Type | Field and Description |
---|---|
protected java.util.Stack<java.util.List<com.saxonica.ee.stream.watch.WatchManager.ClosedownAction>> |
activeWatchStack |
protected int |
elementStackTop |
protected java.util.List<Watch> |
watchList |
pipelineConfiguration, previousAtomic, systemId
Constructor and Description |
---|
WatchManager(PipelineConfiguration pipe)
Create a WatchManager
|
Modifier and Type | Method and Description |
---|---|
protected void |
addPrearrangedWatches() |
void |
addWatch(Watch watch,
boolean autoClose)
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,
java.lang.CharSequence value,
Location locationId,
int properties)
Notify an attribute
|
void |
characters(java.lang.CharSequence chars,
Location locationId,
int properties)
Text node
|
void |
close()
Notify the end of the event stream
|
void |
comment(java.lang.CharSequence chars,
Location locationId,
int properties)
Output a comment
|
void |
endDocument()
Notify the end of a document node
|
void |
endElement()
Notify end of element
|
void |
endGroupingScope()
Called during a partitioning for-each-group whenever a group is closed
|
void |
freezeCurrentGroup()
Called once a new group has been established, to indicate that subsequent watches are not
associated with grouping
|
java.util.Map<Accumulator,AccumulatorWatch> |
getAccumulatorWatchMap()
Get a map from accumulators to AccumulatorWatch instances
|
int |
getDepth() |
FleetingDocumentNode |
getDocumentNode() |
StartTagBuffer |
getStartTagBuffer() |
java.lang.String |
getURIForPrefix(java.lang.String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix.
|
XPathContext |
getXPathContext() |
java.util.Iterator<java.lang.String> |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
void |
namespace(NamespaceBindingSet namespaceBindings,
int properties)
Notify a namespace
|
java.util.List<Watch> |
peekGroupingScope() |
java.util.List<Watch> |
popGroupingScope() |
void |
processingInstruction(java.lang.String target,
java.lang.CharSequence data,
Location locationId,
int properties)
Processing Instruction
|
void |
removeWatch(Watch watch)
Remove a watch
|
void |
setAccumulatorWatchMap(java.util.Map<Accumulator,AccumulatorWatch> accumulatorWatchMap) |
void |
setStartTagBuffer(StartTagBuffer stb) |
void |
setUnparsedEntity(java.lang.String name,
java.lang.String systemID,
java.lang.String publicID)
Notify an unparsed entity URI.
|
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
|
void |
startGroupingScope()
Called during a partitioning for-each-group whenever a new group is started
|
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
protected int elementStackTop
protected java.util.List<Watch> watchList
protected java.util.Stack<java.util.List<com.saxonica.ee.stream.watch.WatchManager.ClosedownAction>> activeWatchStack
public WatchManager(PipelineConfiguration pipe)
pipe
- the pipeline configurationpublic void setStartTagBuffer(StartTagBuffer stb)
public StartTagBuffer getStartTagBuffer()
public void setXPathContext(XPathContext context)
public XPathContext getXPathContext()
public void append(Item item, Location locationId, int copyNamespaces) throws XPathException
append
in class SequenceReceiver
item
- 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_NAMESPACES
XPathException
- if the operation failspublic void close() throws XPathException
close
in interface Receiver
XPathException
- if an error occurspublic void startDocument(int properties) throws XPathException
startDocument
in interface Receiver
properties
- bit-significant integer indicating properties of the document node.
The definitions of the bits are in class ReceiverOptions
XPathException
- if an error occurspublic void startElement(NodeName elementName, SchemaType typeCode, Location location, int properties) throws XPathException
startElement
in interface Receiver
elementName
- 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 ReceiverOptions
XPathException
- if an error occurspublic int getDepth()
protected void addPrearrangedWatches() throws XPathException
XPathException
public void attribute(NodeName nameCode, SimpleType typeCode, java.lang.CharSequence value, Location locationId, int properties) throws XPathException
attribute
in interface Receiver
nameCode
- 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(NamespaceBindingSet namespaceBindings, int properties) throws XPathException
namespace
in interface Receiver
namespaceBindings
- the prefix/uri pair being notifiedproperties
- properties of this eventXPathException
- if any error occurspublic void characters(java.lang.CharSequence chars, Location locationId, int properties) throws XPathException
characters
in interface Receiver
chars
- 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 Receiver
XPathException
- if an error occurspublic void endDocument() throws XPathException
endDocument
in interface Receiver
XPathException
- if an error occurspublic void comment(java.lang.CharSequence chars, Location locationId, int properties) throws XPathException
comment
in interface Receiver
chars
- 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(java.lang.String target, java.lang.CharSequence data, Location locationId, int properties) throws XPathException
processingInstruction
in interface Receiver
target
- 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 Receiver
XPathException
public void setUnparsedEntity(java.lang.String name, java.lang.String systemID, java.lang.String publicID) throws XPathException
setUnparsedEntity
in interface Receiver
setUnparsedEntity
in class SequenceReceiver
name
- The name of the unparsed entitysystemID
- The system identifier of the unparsed entitypublicID
- The public identifier of the unparsed entityXPathException
- if an error occurspublic void addWatch(Watch watch, boolean autoClose) throws XPathException
watch
- the watch to be addedautoClose
- set to true if the watch is to be automatically opened as soon as it is registered,
and is to be automatically closed when it goes out of scope.XPathException
- 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 java.lang.String getURIForPrefix(java.lang.String prefix, boolean useDefault)
getURIForPrefix
in interface NamespaceResolver
prefix
- 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 java.util.Iterator<java.lang.String> iteratePrefixes()
NamespaceResolver
iteratePrefixes
in interface NamespaceResolver
public boolean usesTypeAnnotations()
usesTypeAnnotations
in interface Receiver
public FleetingDocumentNode getDocumentNode()
public java.util.Map<Accumulator,AccumulatorWatch> getAccumulatorWatchMap()
public void setAccumulatorWatchMap(java.util.Map<Accumulator,AccumulatorWatch> accumulatorWatchMap)
public void startGroupingScope()
public void endGroupingScope() throws XPathException
XPathException
public java.util.List<Watch> popGroupingScope()
public java.util.List<Watch> peekGroupingScope()
public void freezeCurrentGroup()
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.