org.exist.indexing
Interface StreamListener

All Known Implementing Classes:
AbstractStreamListener

public interface StreamListener

Callback interface which receives index events. StreamListeners are chained; events should be forwarded to the next listener in the chain (if there is any).


Field Summary
static int REMOVE_ALL_NODES
          Mode for removing all the nodes of a document
static int REMOVE_SOME_NODES
          Mode for removing some nodes of a document
static int STORE
          Mode for storing nodes of a document
static int UNKNOWN
          Undefined mode
 
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.
 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.
 

Field Detail

UNKNOWN

static final int UNKNOWN
Undefined mode

See Also:
Constant Field Values

STORE

static final int STORE
Mode for storing nodes of a document

See Also:
Constant Field Values

REMOVE_ALL_NODES

static final int REMOVE_ALL_NODES
Mode for removing all the nodes of a document

See Also:
Constant Field Values

REMOVE_SOME_NODES

static final int REMOVE_SOME_NODES
Mode for removing some nodes of a document

See Also:
Constant Field Values
Method Detail

getWorker

IndexWorker getWorker()
Retunrs the IndexWorker that owns this listener.

Returns:
the IndexWorker

setNextInChain

void setNextInChain(StreamListener listener)
Set the next stream listener in the chain. Events should always be forwarded to the next listener.

Parameters:
listener - the next listener in the chain.

getNextInChain

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

Returns:
the next listener in the chain.

startElement

void startElement(Txn transaction,
                  ElementImpl element,
                  NodePath path)
Processed the opening tag of an element.

Parameters:
transaction - the current transaction
element - the element which has been stored to the db
path - the current node path

attribute

void attribute(Txn transaction,
               AttrImpl attrib,
               NodePath path)
An attribute has been stored.

Parameters:
transaction - the current transaction
attrib - the attribute which has been stored to the db
path - the current node path

characters

void characters(Txn transaction,
                TextImpl text,
                NodePath path)
A text node has been stored.

Parameters:
transaction - the current transaction
text - the text node which has been stored to the db.
path - the current node path

endElement

void endElement(Txn transaction,
                ElementImpl element,
                NodePath path)
Processed the closing tag of an element.

Parameters:
transaction - the current transaction
element - the element which has been stored to the db
path - the current node path


Copyright (C) Wolfgang Meier. All rights reserved.