public abstract class SearchDocument extends Object
This class is intended to be subclassed by clients.
Modifier | Constructor and Description |
---|---|
protected |
SearchDocument(String documentPath,
SearchParticipant participant)
Creates a new search document.
|
Modifier and Type | Method and Description |
---|---|
void |
addIndexEntry(char[] category,
char[] key)
Adds the given index entry (category and key) coming from this
document to the index.
|
abstract byte[] |
getByteContents()
Returns the contents of this document.
|
abstract char[] |
getCharContents()
Returns the contents of this document.
|
abstract String |
getEncoding()
Returns the encoding for this document.
|
org.eclipse.jdt.internal.compiler.SourceElementParser |
getParser() |
SearchParticipant |
getParticipant()
Returns the participant that created this document.
|
String |
getPath()
Returns the path to the original document to publicly mention in index
or search results.
|
void |
removeAllIndexEntries()
Removes all index entries from the index for the given document.
|
void |
requireIndexingResolvedDocument()
Flags the document as requiring indexing after symbol and type resolution.
|
void |
setIndex(org.eclipse.jdt.internal.core.index.Index indexToSet) |
void |
setParser(org.eclipse.jdt.internal.compiler.SourceElementParser sourceElementParser) |
boolean |
shouldIndexResolvedDocument() |
protected SearchDocument(String documentPath, SearchParticipant participant)
documentPath
- the path to the document,
or null
if noneparticipant
- the participant that creates the search documentpublic void addIndexEntry(char[] category, char[] key)
SearchParticipant.indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath)
.category
- the category of the index entrykey
- the key of the index entrypublic abstract byte[] getByteContents()
This method must be implemented in subclasses.
Note: some implementation may choose to cache the contents directly on the document for performance reason. However, this could induce scalability issues due to the fact that collections of documents are manipulated throughout the search operation, and cached contents would then consume lots of memory until they are all released at once in the end.
null
if nonepublic abstract char[] getCharContents()
This method must be implemented in subclasses.
Note: some implementation may choose to cache the contents directly on the document for performance reason. However, this could induce scalability issues due to the fact that collections of documents are manipulated throughout the search operation, and cached contents would then consume lots of memory until they are all released at once in the end.
null
if nonepublic abstract String getEncoding()
This method must be implemented in subclasses.
null
if nonepublic org.eclipse.jdt.internal.compiler.SourceElementParser getParser()
public final SearchParticipant getParticipant()
public final String getPath()
public void removeAllIndexEntries()
SearchParticipant.indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath)
.public void setIndex(org.eclipse.jdt.internal.core.index.Index indexToSet)
public void setParser(org.eclipse.jdt.internal.compiler.SourceElementParser sourceElementParser)
public void requireIndexingResolvedDocument()
SearchParticipant.resolveDocument(org.eclipse.jdt.core.search.SearchDocument)
and to index the document adding
additional entries via SearchParticipant.indexResolvedDocument(org.eclipse.jdt.core.search.SearchDocument, org.eclipse.core.runtime.IPath)
public boolean shouldIndexResolvedDocument()
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.