org.exist.indexing
Class AbstractMatchListener

java.lang.Object
  extended by org.exist.indexing.AbstractMatchListener
All Implemented Interfaces:
MatchListener, Receiver
Direct Known Subclasses:
FTMatchListener

public class AbstractMatchListener
extends Object
implements MatchListener

Utility implementation of interface MatchListener which forwards all events to a second receiver. Subclass this class and overwrite the methods you are interested in. After processing an event, call the corresponding super method to forward it to the next receiver in the chain.


Field Summary
 
Fields inherited from interface org.exist.util.serializer.Receiver
MATCH_ELEMENT
 
Constructor Summary
AbstractMatchListener()
           
 
Method Summary
 void attribute(QName qname, String value)
           
 void cdataSection(char[] ch, int start, int len)
           
 void characters(CharSequence seq)
           
 void comment(char[] ch, int start, int length)
           
 void documentType(String name, String publicId, String systemId)
           
 void endDocument()
           
 void endElement(QName qname)
           
 void endPrefixMapping(String prefix)
           
 Document getDocument()
           
 Receiver getLastInChain()
          Walks the chain and returns the final receiver.
 Receiver getNextInChain()
          Returns the next receiver in the chain.
 void highlightText(CharSequence seq)
           
 void processingInstruction(String target, String data)
           
 void setCurrentNode(StoredNode node)
           
 void setNextInChain(Receiver next)
          Register the next receiver in the chain.
 void startDocument()
           
 void startElement(QName qname, AttrList attribs)
           
 void startPrefixMapping(String prefix, String namespaceURI)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMatchListener

public AbstractMatchListener()
Method Detail

setNextInChain

public void setNextInChain(Receiver next)
Description copied from interface: MatchListener
Register the next receiver in the chain. All events should be forwarded to this.

Specified by:
setNextInChain in interface MatchListener
Parameters:
next - the next receiver in the chain.

getNextInChain

public Receiver getNextInChain()
Description copied from interface: MatchListener
Returns the next receiver in the chain.

Specified by:
getNextInChain in interface MatchListener
Returns:
the next receiver

getLastInChain

public Receiver getLastInChain()
Description copied from interface: MatchListener
Walks the chain and returns the final receiver.

Specified by:
getLastInChain in interface MatchListener
Returns:
the last receiver in the chain

setCurrentNode

public void setCurrentNode(StoredNode node)
Specified by:
setCurrentNode in interface Receiver

getDocument

public Document getDocument()
Specified by:
getDocument in interface Receiver

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface Receiver
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface Receiver
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String namespaceURI)
                        throws SAXException
Specified by:
startPrefixMapping in interface Receiver
Throws:
SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface Receiver
Throws:
SAXException

startElement

public void startElement(QName qname,
                         AttrList attribs)
                  throws SAXException
Specified by:
startElement in interface Receiver
Throws:
SAXException

endElement

public void endElement(QName qname)
                throws SAXException
Specified by:
endElement in interface Receiver
Throws:
SAXException

characters

public void characters(CharSequence seq)
                throws SAXException
Specified by:
characters in interface Receiver
Throws:
SAXException

attribute

public void attribute(QName qname,
                      String value)
               throws SAXException
Specified by:
attribute in interface Receiver
Throws:
SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Specified by:
comment in interface Receiver
Throws:
SAXException

cdataSection

public void cdataSection(char[] ch,
                         int start,
                         int len)
                  throws SAXException
Specified by:
cdataSection in interface Receiver
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface Receiver
Throws:
SAXException

documentType

public void documentType(String name,
                         String publicId,
                         String systemId)
                  throws SAXException
Specified by:
documentType in interface Receiver
Throws:
SAXException

highlightText

public void highlightText(CharSequence seq)
                   throws SAXException
Specified by:
highlightText in interface Receiver
Throws:
SAXException


Copyright (C) Wolfgang Meier. All rights reserved.