public abstract class SearchParticipantXML extends SearchParticipant
Modifier and Type | Class and Description |
---|---|
protected static interface |
SearchParticipantXML.IParsedXMLContent
Class that implements this interface is used to store data obtained during the parsing phase.
|
Constructor and Description |
---|
SearchParticipantXML() |
Modifier and Type | Method and Description |
---|---|
IStatus |
addDocument(IHelpSearchIndex index,
String pluginId,
String name,
URL url,
String id,
ISearchDocument 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(SearchParticipantXML.IParsedXMLContent data)
Called when the XML document has been ended.
|
protected abstract void |
handleEndElement(String name,
SearchParticipantXML.IParsedXMLContent data)
Called when the element has been ended.
|
protected void |
handleProcessingInstruction(String type,
SearchParticipantXML.IParsedXMLContent data)
Called when a processing instruction has been encountered.
|
protected void |
handleStartDocument(SearchParticipantXML.IParsedXMLContent data)
Called when the XML document has been started.
|
protected abstract void |
handleStartElement(String name,
Attributes attributes,
SearchParticipantXML.IParsedXMLContent data)
Called when the element has been started.
|
protected abstract void |
handleText(String text,
SearchParticipantXML.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.
|
addTitle, clear, getAllDocuments, getContributingPlugins, getId, init, open, resolveVariables
protected abstract void handleStartElement(String name, Attributes attributes, SearchParticipantXML.IParsedXMLContent data)
name
- the element nameattributes
- the element attributesdata
- data the parser content data to updateprotected abstract void handleEndElement(String name, SearchParticipantXML.IParsedXMLContent data)
name
- the name of the XML elementdata
- data the parser content data to updateprotected void handleStartDocument(SearchParticipantXML.IParsedXMLContent data)
data
- data the parser content data to updateprotected void handleEndDocument(SearchParticipantXML.IParsedXMLContent data)
data
- data the parser content data to updateprotected void handleProcessingInstruction(String type, SearchParticipantXML.IParsedXMLContent data)
type
- the instruction datadata
- the parser content data to updateprotected abstract void handleText(String text, SearchParticipantXML.IParsedXMLContent data)
text
- the body textdata
- the parser content data to updatepublic IStatus addDocument(IHelpSearchIndex index, String pluginId, String name, URL url, String id, ISearchDocument doc)
SearchParticipant
addDocument
in class SearchParticipant
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 document to add searchable content toStatus.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"
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.