org.netbeans.modules.parsing.api/1 1.55.0 6

org.netbeans.modules.parsing.spi.indexing
Class Context

java.lang.Object
  extended by org.netbeans.modules.parsing.spi.indexing.Context

public final class Context
extends Object

Represents a context of indexing given root.


Method Summary
 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()
           
 boolean isSourceForBinaryRootIndexing()
          Indicates whether sources of some binary library are being indexed.
 boolean isSupplementaryFilesIndexing()
          Indicates whether the current indexing job was requested by calling addSupplementaryFiles(java.net.URL, java.util.Collection) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIndexFolder

public FileObject getIndexFolder()
Returns the cache folder where the indexer may store language metadata. For each root and indexer there exist a separate cache folder.

Returns:
The cache folder

getRootURI

public URL getRootURI()
Return the URL of the processed root

Returns:
the absolute URL

getRoot

public FileObject getRoot()
Return the processed root, may return null when the processed root was deleted. The getRootURI() can be used in this case.

Returns:
the root or null when the root doesn't exist

addSupplementaryFiles

public void addSupplementaryFiles(URL root,
                                  Collection<? extends URL> files)
Schedules additional files for reindexing. This method can be used for requesting reindexing of additional files that an indexer discovers while indexing some other files. The files passed to this method will be processed by a new indexing job after the current indexing is finished. That means that all the indexers appropriate for each file will have a chance to update their index. No timestamp checks are done on the additional files, which means that even files that have not been changed since their last indexing will be reindexed again.

Parameters:
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.
Since:
1.3

isSupplementaryFilesIndexing

public boolean isSupplementaryFilesIndexing()
Indicates whether the current indexing job was requested by calling addSupplementaryFiles(java.net.URL, java.util.Collection) method.

Returns:
true if the indexing job was requested by addSupplementaryFiles, otherwise false.
Since:
1.3

isAllFilesIndexing

public boolean isAllFilesIndexing()
Indicates whether all files under the root are being indexed. In general indexing jobs can either index selected files under a given root (eg. when scheduled through IndexingManager) or they can index all files under the root. Some indexers are interested in knowing this information in order to optimize their indexing.

Returns:
true if indexing all files under the root.
Since:
1.6

isSourceForBinaryRootIndexing

public boolean isSourceForBinaryRootIndexing()
Indicates whether sources of some binary library are being indexed. Some indexers are interested in knowing this information in order to optimize their indexing.

Returns:
true if indexing sources for binary root.
Since:
1.17

checkForEditorModifications

public boolean checkForEditorModifications()
Notifies indexers whether they should use editor documents rather than just files. This is mostly useful for 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.

Returns:
false if indexers don't have to care about possible editor modifications or true otherwise.
Since:
1.10

isCancelled

public boolean isCancelled()
Returns:
Since:
1.13

getSuspendStatus

@NonNull
public SuspendStatus getSuspendStatus()
Returns SuspendStatus providing information about indexing suspension.

Returns:
the SuspendStatus
Since:
1.52

org.netbeans.modules.parsing.api/1 1.55.0 6

Built on May 24 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.