org.exist.indexing
Class AbstractStreamListener

java.lang.Object
  extended by org.exist.indexing.AbstractStreamListener
All Implemented Interfaces:
StreamListener

public abstract class AbstractStreamListener
extends Object
implements StreamListener

Default implementation of a StreamListener. By default forwards all events to the next listener in the chain (if there is any). Overwrite methods to handle events (but don't forget to call the super method as well).


Field Summary
 
Fields inherited from interface org.exist.indexing.StreamListener
REMOVE_ALL_NODES, REMOVE_SOME_NODES, STORE, UNKNOWN
 
Constructor Summary
AbstractStreamListener()
           
 
Method Summary
 void attribute(Txn transaction, AttrImpl attrib, NodePath path)
          An attribute has been stored.
 void characters(Txn transaction, TextImpl text, NodePath path)
          A text node has been stored.
 void endElement(Txn transaction, ElementImpl element, NodePath path)
          Processed the closing tag of an element.
 StreamListener getNextInChain()
          Returns the next stream listener in the chain.
abstract  IndexWorker getWorker()
          Retunrs the IndexWorker that owns this listener.
 void setNextInChain(StreamListener listener)
          Set the next stream listener in the chain.
 void startElement(Txn transaction, ElementImpl element, NodePath path)
          Processed the opening tag of an element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStreamListener

public AbstractStreamListener()
Method Detail

setNextInChain

public void setNextInChain(StreamListener listener)
Description copied from interface: StreamListener
Set the next stream listener in the chain. Events should always be forwarded to the next listener.

Specified by:
setNextInChain in interface StreamListener
Parameters:
listener - the next listener in the chain.

getNextInChain

public StreamListener getNextInChain()
Description copied from interface: StreamListener
Returns the next stream listener in the chain. This should usually be the one that was passed in from StreamListener.setNextInChain(StreamListener).

Specified by:
getNextInChain in interface StreamListener
Returns:
the next listener in the chain.

startElement

public void startElement(Txn transaction,
                         ElementImpl element,
                         NodePath path)
Description copied from interface: StreamListener
Processed the opening tag of an element.

Specified by:
startElement in interface StreamListener
Parameters:
transaction - the current transaction
element - the element which has been stored to the db
path - the current node path

attribute

public void attribute(Txn transaction,
                      AttrImpl attrib,
                      NodePath path)
Description copied from interface: StreamListener
An attribute has been stored.

Specified by:
attribute in interface StreamListener
Parameters:
transaction - the current transaction
attrib - the attribute which has been stored to the db
path - the current node path

endElement

public void endElement(Txn transaction,
                       ElementImpl element,
                       NodePath path)
Description copied from interface: StreamListener
Processed the closing tag of an element.

Specified by:
endElement in interface StreamListener
Parameters:
transaction - the current transaction
element - the element which has been stored to the db
path - the current node path

characters

public void characters(Txn transaction,
                       TextImpl text,
                       NodePath path)
Description copied from interface: StreamListener
A text node has been stored.

Specified by:
characters in interface StreamListener
Parameters:
transaction - the current transaction
text - the text node which has been stored to the db.
path - the current node path

getWorker

public abstract IndexWorker getWorker()
Description copied from interface: StreamListener
Retunrs the IndexWorker that owns this listener.

Specified by:
getWorker in interface StreamListener
Returns:
the IndexWorker


Copyright (C) Wolfgang Meier. All rights reserved.