public final class Context extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addSupplementaryFiles(URL root,
Collection<? extends URL> files)
Schedules additional files for reindexing.
|
boolean |
checkForEditorModifications()
Notifies indexers whether they should use editor documents rather than just
files.
|
FileObject |
getIndexFolder()
Returns the cache folder where the indexer may store language metadata.
|
FileObject |
getRoot()
Return the processed root, may return null
when the processed root was deleted.
|
URL |
getRootURI()
Return the
URL of the processed root |
SuspendStatus |
getSuspendStatus()
Returns
SuspendStatus providing information
about indexing suspension. |
boolean |
isAllFilesIndexing()
Indicates whether all files under the root are being indexed.
|
boolean |
isCancelled()
Returns true if the indexing job is canceled either by external event like
IDE exit or by a new indexing job which obscures the current one.
|
boolean |
isSourceForBinaryRootIndexing()
Indicates whether sources of some binary library are being indexed.
|
boolean |
isSupplementaryFilesIndexing()
Indicates whether the current indexing job was requested by calling
Context.addSupplementaryFiles(java.net.URL, java.util.Collection) method. |
public FileObject getIndexFolder()
public FileObject getRoot()
Context.getRootURI() can be used in
this case.public void addSupplementaryFiles(URL root, Collection<? extends URL> files)
root - The common parent folder of the files that should be reindexed.files - The files to reindex. Can be null or an empty
collection in which case all files under the root will
be reindexed.public boolean isSupplementaryFilesIndexing()
Context.addSupplementaryFiles(java.net.URL, java.util.Collection) method.true if the indexing job was requested by addSupplementaryFiles,
otherwise false.public boolean isAllFilesIndexing()
IndexingManager) or they can index all files under the root. Some
indexers are interested in knowing this information in order to optimize their
indexing.true if indexing all files under the root.public boolean isSourceForBinaryRootIndexing()
true if indexing sources for binary root.public boolean checkForEditorModifications()
CustomIndexers that may optimize
their work and not try to find editor documents for their Indexables.
EmbeddingIndexers can safely ignore this flag since they operate
on Parser.Results and Snapshots, which are guaranteed
to be in sync with editor documents or loaded efficiently from a file if the
file is not opened in the editor.
false if indexers don't have to care about possible
editor modifications or true otherwise.public boolean isCancelled()
Context.isCancelled() in its index method
and return as soon as possible if it returns true. The indexer factory should
also check the Context.isCancelled() if it overrides the
SourceIndexerFactory.scanFinished(org.netbeans.modules.parsing.spi.indexing.Context)
method, when it's true the scanFinished should roll back all changes. The changes done into
IndexingSupport are rolled back automatically.@NonNull public SuspendStatus getSuspendStatus()
SuspendStatus providing information
about indexing suspension.SuspendStatus