public class LuceneTermHighlighter extends GenericPipeline implements TermHighlighter
SdxObject.ConfigurationNode
keepStep, transformations, transformsList
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
CLASS_NAME_SUFFIX, PACKAGE_QUALNAME
DEFAULT_ENCODING
Constructor and Description |
---|
LuceneTermHighlighter() |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] c,
int start,
int len) |
void |
endElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw) |
protected org.xml.sax.Attributes |
getHilitedAttributes(org.xml.sax.Attributes a) |
void |
highlightTerm(java.lang.String term,
java.lang.String termText)
Highlight an arbitrary term.
|
void |
recycle()
Recycle the producer by removing references
|
void |
setQuery(Query query)
Set's up the pipeline
|
void |
setTerms(Terms terms) |
void |
startElement(java.lang.String uri,
java.lang.String loc,
java.lang.String raw,
org.xml.sax.Attributes a) |
addTransformation, configure, getClassNameSuffix, getParameters, getTransformedBytes, getTransformedFile, initToSax, initVolatileObjectsToSax, newInstance, setConsumer, setParameters, setParametersToTransformations, verifyConfigurationParameters
configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources
comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping
setContentHandler, setLexicalHandler
getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTransformation, getParameters, getTransformedBytes, getTransformedFile, newInstance, setParameters
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
getId, setId
getDescription, setDescription
getEncoding, setEncoding
getLocale, getXmlLang, setLocale, setXmlLang
public void setQuery(Query query) throws SDXException
setQuery
in interface TermHighlighter
query
- The sdx query object on which the results are basedSDXException
public void setTerms(Terms terms)
setTerms
in interface TermHighlighter
public void highlightTerm(java.lang.String term, java.lang.String termText) throws org.xml.sax.SAXException
return "<b>" + term + "</b>";
term
- term text to highlighttermText
- the string value of the term on which the comparison was madeorg.xml.sax.SAXException
public void characters(char[] c, int start, int len) throws org.xml.sax.SAXException
characters
in interface org.xml.sax.ContentHandler
characters
in class org.apache.cocoon.xml.AbstractXMLPipe
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String loc, java.lang.String raw) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.apache.cocoon.xml.AbstractXMLPipe
org.xml.sax.SAXException
public void startElement(java.lang.String uri, java.lang.String loc, java.lang.String raw, org.xml.sax.Attributes a) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.apache.cocoon.xml.AbstractXMLPipe
org.xml.sax.SAXException
protected org.xml.sax.Attributes getHilitedAttributes(org.xml.sax.Attributes a) throws SDXException, java.io.IOException
SDXException
java.io.IOException
public void recycle()
recycle
in interface TermHighlighter
recycle
in interface org.apache.avalon.excalibur.pool.Recyclable
recycle
in class org.apache.cocoon.xml.AbstractXMLProducer
Copyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.