|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.help.search.LuceneSearchParticipant
org.eclipse.help.search.XMLSearchParticipant
An abstract search participants for adding XML documents to the Lucene search index. Subclass it and implement or override protected methods to handle parsing of the document.
Nested Class Summary | |
---|---|
protected static interface |
XMLSearchParticipant.IParsedXMLContent
Class that implements this interface is used to store data obtained during the parsing phase. |
Constructor Summary | |
---|---|
XMLSearchParticipant()
|
Method Summary | |
---|---|
IStatus |
addDocument(ISearchIndex index,
String pluginId,
String name,
URL url,
String id,
org.apache.lucene.document.Document doc)
Adds the document to the search index. |
protected String |
getElementStackPath()
Returns the full path of the current element in the stack separated by the '/' character. |
protected String |
getTopElement()
Returns the name of the element that is currently at the top of the element stack. |
protected void |
handleEndDocument(XMLSearchParticipant.IParsedXMLContent data)
Called when the XML document has been ended. |
protected abstract void |
handleEndElement(String name,
XMLSearchParticipant.IParsedXMLContent data)
Called when the element has been ended. |
protected void |
handleProcessingInstruction(String type,
XMLSearchParticipant.IParsedXMLContent data)
Called when a processing instruction has been encountered. |
protected void |
handleStartDocument(XMLSearchParticipant.IParsedXMLContent data)
Called when the XML document has been started. |
protected abstract void |
handleStartElement(String name,
Attributes attributes,
XMLSearchParticipant.IParsedXMLContent data)
Called when the element has been started. |
protected abstract void |
handleText(String text,
XMLSearchParticipant.IParsedXMLContent data)
Called when element body text has been encountered. |
protected InputStream |
preprocess(InputStream in,
String name,
String locale)
Pre-processes the given document input stream for the given document name and locale. |
Methods inherited from class org.eclipse.help.search.LuceneSearchParticipant |
---|
addTitle, clear, getAllDocuments, getContributingPlugins, getId, init, open, resolveVariables |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLSearchParticipant()
Method Detail |
protected abstract void handleStartElement(String name, Attributes attributes, XMLSearchParticipant.IParsedXMLContent data)
name
- the element nameattributes
- the element attributesdata
- data the parser content data to updateprotected abstract void handleEndElement(String name, XMLSearchParticipant.IParsedXMLContent data)
name
- the name of the XML elementdata
- data the parser content data to updateprotected void handleStartDocument(XMLSearchParticipant.IParsedXMLContent data)
data
- data the parser content data to updateprotected void handleEndDocument(XMLSearchParticipant.IParsedXMLContent data)
data
- data the parser content data to updateprotected void handleProcessingInstruction(String type, XMLSearchParticipant.IParsedXMLContent data)
type
- the instruction datadata
- the parser content data to updateprotected abstract void handleText(String text, XMLSearchParticipant.IParsedXMLContent data)
text
- the body textdata
- the parser content data to updatepublic IStatus addDocument(ISearchIndex index, String pluginId, String name, URL url, String id, org.apache.lucene.document.Document doc)
LuceneSearchParticipant
addDocument
in class LuceneSearchParticipant
index
- the abstract representation of the help index that is currently running. Indexing
known file types in participants that manage documents outside the TOC can be
delegated to the index.pluginId
- the plug-in that owns the documentname
- the name of the document to indexurl
- the url of the document to indexid
- the unique id associated with this documentdoc
- the Lucene document to add searchable content to
Status.OK
.protected String getTopElement()
protected String getElementStackPath()
protected InputStream preprocess(InputStream in, String name, String locale)
Pre-processes the given document input stream for the given document name and locale. This implementation will resolve dynamic content that is applicable to searching, e.g. includes and extensions, but not filters. Subclasses may override to do their own pre-processing.
For performance, implementations that handle documents that do not support dynamic content should subclass and return the original stream.
in
- the input stream for the document contentname
- the name of the document as it appears in the indexlocale
- the locale code, e.g. "en_US"
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.