|
Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XPathStreamObserver
Defines objects which wish to be notified when events encountered in an XMLInputStream
match a particular xpath. When the stream's client asks for the next()
event, it is evaluated against an xpath; if it matches, the observer is notified of the event via the observeMatch()
just before it is returned to the client.
Instances of this class are installed in an
where they are paired with a XPathStreamFactory
for which they wish to receive match notifications.StreamXPath
Since XPathSreamObservers
will receive notifications on all of the streams created by the XPathStreamFactory
in which they are installed, it is usually necessary for them to be stateless unless it can be guaranteed that the observer will never be accessed by multiple threads or for matching against different streams.
An example of such a case may occur if a client wishes to alter the stream based on xpath matches. Although this interface does not provide facilities for altering the stream, match-based mutations of the stream can easily be performed by creating a new class which does the following:
XMLInputStream
XPathStreamObserver
XPathStreamFactory
.XMLInputStream
created by that factory.observeMatch
that produces some state that is consumed by its implementation of XMLInputStream.next()
. Typically, this might mean that observeMatch()
writes replacement events to an intermediate event buffer which is drained by the implementation of next()
, which will always try to return the next element from the buffer, and returns super.next()
only if the buffer is empty.Method Summary | |
---|---|
abstract void |
observe(XMLEvent event) Handles notification when an XMLEvent is encountered on the stream which represents a matching node that is not an attribute or namespace node. |
abstract void |
observeAttribute(StartElement event, Attribute attribute) Handles notification when an XMLEvent is encountered on the stream which contains an attribute meets the criteria with which the observer was installed in the XPathStreamFactory. |
abstract void |
observeNamespace(StartElement event, Attribute attribute) |
Method Detail |
---|
void observe(XMLEvent event)
event
- The XMLEvent which matched the XPath.void observeAttribute(StartElement event, Attribute attribute)
event
- The XMLEvent which contains the attribute which matchedattribute
- The Attribute which matchedvoid observeNamespace(StartElement event, Attribute attribute)
event
- The XMLEvent which contains the attribute which matchedattribute
- The Attribute which contains the matched namespace declaration which matched
|
Copyright 1996, 2015, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Oracle Fusion Middleware Java API Reference for Oracle WebLogic Server 12c (12.2.1) Part Number E55141-01 P4 Change 1723563 on 2015/10/09 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |