lux.search.highlight
Class XmlHighlighter

java.lang.Object
  extended by lux.xml.SaxonDocBuilder
      extended by lux.search.highlight.XmlHighlighter
All Implemented Interfaces:
StAXHandler

public class XmlHighlighter
extends SaxonDocBuilder


Field Summary
 
Fields inherited from class lux.xml.SaxonDocBuilder
writer
 
Constructor Summary
XmlHighlighter(net.sf.saxon.s9api.Processor processor, IndexConfiguration indexConfig, HighlightFormatter highlighter)
           
 
Method Summary
 void handleEvent(XMLStreamReader reader, int eventType)
          This method receives StAX events.
 net.sf.saxon.s9api.XdmNode highlight(org.apache.lucene.search.Query query, net.sf.saxon.om.NodeInfo node)
           
 void reset()
          reinitialize any internal state and prepare the handler for re-use
 
Methods inherited from class lux.xml.SaxonDocBuilder
getDocument, getOffsets
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlHighlighter

public XmlHighlighter(net.sf.saxon.s9api.Processor processor,
                      IndexConfiguration indexConfig,
                      HighlightFormatter highlighter)
Method Detail

highlight

public net.sf.saxon.s9api.XdmNode highlight(org.apache.lucene.search.Query query,
                                            net.sf.saxon.om.NodeInfo node)
                                     throws XMLStreamException,
                                            net.sf.saxon.s9api.SaxonApiException
Throws:
XMLStreamException
net.sf.saxon.s9api.SaxonApiException

reset

public void reset()
Description copied from interface: StAXHandler
reinitialize any internal state and prepare the handler for re-use

Specified by:
reset in interface StAXHandler
Overrides:
reset in class SaxonDocBuilder

handleEvent

public void handleEvent(XMLStreamReader reader,
                        int eventType)
                 throws XMLStreamException
Description copied from interface: StAXHandler
This method receives StAX events. It should never call XMLStreamReader.next() since if it does, its caller will miss the event.

Specified by:
handleEvent in interface StAXHandler
Overrides:
handleEvent in class SaxonDocBuilder
Parameters:
reader - the reader from which events are being read
eventType - the XML stream event type
Throws:
XMLStreamException


Copyright © 2013. All Rights Reserved.