public abstract class SearchDocument
extends org.eclipse.wst.jsdt.internal.core.search.indexing.InternalSearchDocument
This class is intended to be subclassed by clients.
Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.Modifier | Constructor and Description |
---|---|
protected |
SearchDocument(java.lang.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 java.lang.String |
getEncoding()
Returns the encoding for this document.
|
IJavaScriptElement |
getJavaElement() |
SearchParticipant |
getParticipant()
Returns the participant that created this document.
|
java.lang.String |
getPath()
Returns the path to the original document to publicly mention in index
or search results.
|
boolean |
isVirtual() |
void |
removeAllIndexEntries()
Removes all index entries from the index for the given document.
|
protected SearchDocument(java.lang.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)
.addIndexEntry
in class org.eclipse.wst.jsdt.internal.core.search.indexing.InternalSearchDocument
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 java.lang.String getEncoding()
This method must be implemented in subclasses.
null
if nonepublic final SearchParticipant getParticipant()
public final java.lang.String getPath()
getPath
in class org.eclipse.wst.jsdt.internal.core.search.indexing.InternalSearchDocument
public void removeAllIndexEntries()
SearchParticipant#indexDocument(SearchDocument document, org.eclipse.core.runtime.IPath indexPath)
.removeAllIndexEntries
in class org.eclipse.wst.jsdt.internal.core.search.indexing.InternalSearchDocument
public boolean isVirtual()
public IJavaScriptElement getJavaElement()
Copyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.