Klasse SearchDocument
- Bekannte direkte Unterklassen:
JavaSearchDocument
This class is intended to be subclassed by clients.
- Seit:
- 3.0
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedSearchDocument(String documentPath, SearchParticipant participant) Creates a new search document. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddIndexEntry(char[] category, char[] key) Adds the given index entry (category and key) coming from this document to the index.abstract byte[]Returns the contents of this document.abstract char[]Returns the contents of this document.abstract StringReturns the encoding for this document.final SearchParticipantReturns the participant that created this document.final StringgetPath()Returns the path to the original document to publicly mention in index or search results.voidRemoves all index entries from the index for the given document.voidFlags the document as requiring indexing after symbol and type resolution.voidvoidsetParser(SourceElementParser sourceElementParser) boolean
-
Konstruktordetails
-
SearchDocument
Creates a new search document. The given document path is a string that uniquely identifies the document. Most of the time it is a workspace-relative path, but it can also be a file system path, or a path inside a zip file.- Parameter:
documentPath- the path to the document, ornullif noneparticipant- the participant that creates the search document
-
-
Methodendetails
-
addIndexEntry
public void addIndexEntry(char[] category, char[] key) Adds the given index entry (category and key) coming from this document to the index. This method must be called fromSearchParticipant.indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath).- Parameter:
category- the category of the index entrykey- the key of the index entry
-
getByteContents
public abstract byte[] getByteContents()Returns the contents of this document. Contents may be different from actual resource at corresponding document path, in case of preprocessing.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.
- Gibt zurück:
- the contents of this document,
or
nullif none
-
getCharContents
public abstract char[] getCharContents()Returns the contents of this document. Contents may be different from actual resource at corresponding document path due to preprocessing.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.
- Gibt zurück:
- the contents of this document,
or
nullif none
-
getEncoding
Returns the encoding for this document.This method must be implemented in subclasses.
- Gibt zurück:
- the encoding for this document,
or
nullif none
-
getParser
-
getParticipant
Returns the participant that created this document.- Gibt zurück:
- the participant that created this document
-
getPath
Returns the path to the original document to publicly mention in index or search results. This path is a string that uniquely identifies the document. Most of the time it is a workspace-relative path, but it can also be a file system path, or a path inside a zip file.- Gibt zurück:
- the path to the document
-
removeAllIndexEntries
public void removeAllIndexEntries()Removes all index entries from the index for the given document. This method must be called fromSearchParticipant.indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath). -
setIndex
-
setParser
-
requireIndexingResolvedDocument
public void requireIndexingResolvedDocument()Flags the document as requiring indexing after symbol and type resolution. A participant would be asked to resolve the document viaSearchParticipant.resolveDocument(org.aspectj.org.eclipse.jdt.core.search.SearchDocument)and to index the document adding additional entries viaSearchParticipant.indexResolvedDocument(org.aspectj.org.eclipse.jdt.core.search.SearchDocument, org.eclipse.core.runtime.IPath)- Seit:
- 3.10
-
shouldIndexResolvedDocument
public boolean shouldIndexResolvedDocument()
-