Package org.eclipse.help.search
Class SearchParticipantXML
java.lang.Object
org.eclipse.help.search.SearchParticipant
org.eclipse.help.search.SearchParticipantXML
An abstract search participants for adding XML documents to the search index. Subclass it
 and implement or override protected methods to handle parsing of the document.
- Since:
- 3.5
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static interfaceClass that implements this interface is used to store data obtained during the parsing phase.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddDocument(IHelpSearchIndex index, String pluginId, String name, URL url, String id, ISearchDocument doc) Adds the document to the search index.protected StringReturns the full path of the current element in the stack separated by the '/' character.protected StringReturns the name of the element that is currently at the top of the element stack.protected voidCalled when the XML document has been ended.protected abstract voidCalled when the element has been ended.protected voidCalled when a processing instruction has been encountered.protected voidCalled when the XML document has been started.protected abstract voidhandleStartElement(String name, Attributes attributes, SearchParticipantXML.IParsedXMLContent data) Called when the element has been started.protected abstract voidhandleText(String text, SearchParticipantXML.IParsedXMLContent data) Called when element body text has been encountered.protected InputStreampreprocess(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.SearchParticipantaddTitle, clear, getAllDocuments, getContributingPlugins, getId, init, open, resolveVariables
- 
Constructor Details- 
SearchParticipantXMLpublic SearchParticipantXML()
 
- 
- 
Method Details- 
handleStartElementprotected abstract void handleStartElement(String name, Attributes attributes, SearchParticipantXML.IParsedXMLContent data) Called when the element has been started.- Parameters:
- name- the element name
- attributes- the element attributes
- data- data the parser content data to update
 
- 
handleEndElementCalled when the element has been ended.- Parameters:
- name- the name of the XML element
- data- data the parser content data to update
 
- 
handleStartDocumentCalled when the XML document has been started.- Parameters:
- data- data the parser content data to update
 
- 
handleEndDocumentCalled when the XML document has been ended.- Parameters:
- data- data the parser content data to update
 
- 
handleProcessingInstructionprotected void handleProcessingInstruction(String type, SearchParticipantXML.IParsedXMLContent data) Called when a processing instruction has been encountered.- Parameters:
- type- the instruction data
- data- the parser content data to update
 
- 
handleTextCalled when element body text has been encountered. Use 'getElementStackPath()' to determine the element in question.- Parameters:
- text- the body text
- data- the parser content data to update
 
- 
addDocumentpublic IStatus addDocument(IHelpSearchIndex index, String pluginId, String name, URL url, String id, ISearchDocument doc) Description copied from class:SearchParticipantAdds the document to the search index.- Specified by:
- addDocumentin class- SearchParticipant
- Parameters:
- 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 document
- name- the name of the document to index
- url- the url of the document to index
- id- the unique id associated with this document
- doc- the document to add searchable content to
- Returns:
- the status of the indexing operation. A successful operation should return
         Status.OK.
 
- 
getTopElementReturns the name of the element that is currently at the top of the element stack.- Returns:
- the name of the element that is currently at the top of the element stack
 
- 
getElementStackPathReturns the full path of the current element in the stack separated by the '/' character.- Returns:
- the path to the current element in the stack.
 
- 
preprocessPre-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. - Parameters:
- in- the input stream for the document content
- name- the name of the document as it appears in the index
- locale- the locale code, e.g. "en_US"
- Returns:
- the processed content
- Since:
- 3.3
 
 
-