|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.event.SequenceReceiver net.sf.saxon.event.ProxyReceiver com.saxonica.stream.WatchManager
public class WatchManager
This class sits on a push pipeline and evaluates the passing element and attribute nodes. One or more Watch objects can be registered with the pipeline at any time; element and attribute events are notified to the active Watch objects. A watch that is added immediately after a startElement call is automatically dropped at the corresponding endElement call. If a Watch matches a startElement call, then it becomes an active Watch; it is automatically deactivated (but not dropped) at the corresponding endElement call.
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.
Field Summary | |
---|---|
protected Stack |
activeWatchStack
|
protected int |
elementStackTop
|
static List |
EMPTY_WATCH_LIST
|
protected List |
watchList
|
Fields inherited from class net.sf.saxon.event.ProxyReceiver |
---|
nextReceiver |
Fields inherited from class net.sf.saxon.event.SequenceReceiver |
---|
pipelineConfiguration, previousAtomic, systemId |
Fields inherited from interface javax.xml.transform.Result |
---|
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
---|---|
WatchManager()
Create a WatchManager |
Method Summary | |
---|---|
void |
addWatch(Watch watch)
Add a new Watch. |
void |
attribute(int nameCode,
int 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 |
endElement()
Notify end of element |
String |
getURIForPrefix(String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix. |
Iterator |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context. |
void |
namespace(int namespaceCode,
int properties)
Notify a namespace |
void |
processingInstruction(String target,
CharSequence data,
int locationId,
int properties)
Processing Instruction |
void |
startContent()
Start element content (called after all the attributes and namespaces have been processed) |
void |
startElement(int nameCode,
int 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 |
Methods inherited from class net.sf.saxon.event.ProxyReceiver |
---|
append, close, endDocument, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, open, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startDocument |
Methods inherited from class net.sf.saxon.event.SequenceReceiver |
---|
getPipelineConfiguration, getSystemId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int elementStackTop
protected List watchList
protected Stack activeWatchStack
public static final List EMPTY_WATCH_LIST
Constructor Detail |
---|
public WatchManager()
Method Detail |
---|
public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException
startElement
in interface Receiver
startElement
in class ProxyReceiver
nameCode
- 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 node
XPathException
public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException
attribute
in interface Receiver
attribute
in class ProxyReceiver
nameCode
- 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(int namespaceCode, int properties) throws XPathException
namespace
in interface Receiver
namespace
in class ProxyReceiver
namespaceCode
- the namespace code (identifies the prefix and URI)properties
- properties of this event
XPathException
public void characters(CharSequence chars, int locationId, int properties) throws XPathException
characters
in interface Receiver
characters
in class ProxyReceiver
chars
- 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
public void endElement() throws XPathException
endElement
in interface Receiver
endElement
in class ProxyReceiver
XPathException
public void comment(CharSequence chars, int locationId, int properties) throws XPathException
comment
in interface Receiver
comment
in class ProxyReceiver
chars
- 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. The following bits are
defined:
XPathException
public void processingInstruction(String target, CharSequence data, int locationId, int properties) throws XPathException
processingInstruction
in interface Receiver
processingInstruction
in class ProxyReceiver
target
- 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. The following bits are
defined:
XPathException
public void startContent() throws XPathException
startContent
in interface Receiver
startContent
in class ProxyReceiver
XPathException
public void addWatch(Watch watch)
watch
- the watch to be addedpublic String getURIForPrefix(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 Iterator iteratePrefixes()
NamespaceResolver
iteratePrefixes
in interface NamespaceResolver
public boolean usesTypeAnnotations()
usesTypeAnnotations
in interface Receiver
usesTypeAnnotations
in class ProxyReceiver
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |