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

org.netbeans.modules.parsing.spi.indexing.support
Class IndexingSupport

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

public final class IndexingSupport
extends Object

Support for writing indexers. Provides persistent storage for indexers.


Method Summary
 void addDocument(IndexDocument document)
          Adds a new IndexDocument into the index
 IndexDocument createDocument(FileObject file)
          Creates a new IndexDocument.
 IndexDocument createDocument(Indexable indexable)
          Creates a new IndexDocument.
static IndexingSupport getInstance(Context context)
          Returns an IndexingSupport for given indexing Context
 boolean isValid()
          Checks a validity of the index

Implementations of the SourceIndexerFactory should check the validity of the index in the SourceIndexerFactory.scanStarted(org.netbeans.modules.parsing.spi.indexing.Context) method and force reindexing of the root for which the index is broken.

 void markDirtyDocuments(Indexable indexable)
          Marks all documents for an Indexable as dirty.
 void removeDocuments(Indexable indexable)
          Removes all documents for given indexables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IndexingSupport getInstance(Context context)
                                   throws IOException
Returns an IndexingSupport for given indexing Context

Parameters:
context - for which the support should be returned
Returns:
the context
Throws:
IOException - when underlying storage is corrupted or cannot be created

isValid

public boolean isValid()
Checks a validity of the index

Implementations of the SourceIndexerFactory should check the validity of the index in the SourceIndexerFactory.scanStarted(org.netbeans.modules.parsing.spi.indexing.Context) method and force reindexing of the root for which the index is broken. In case of CSL based factories the check is done by the CSL itself.

Returns:
false when the index exists but it's broken
Since:
1.21

createDocument

public IndexDocument createDocument(FileObject file)
Creates a new IndexDocument. This method does exactly the same as {@link #createDocument(org.netbeans.modules.parsing.spi.indexing.Indexable), but you can use FileObjects directly. The FileObject passed in as a parameter has to be in the folders hierarchy under the root, which this IndexingSupport instance was created for.

Parameters:
file - The file to create IndexDocument for.
Returns:
The IndexDocument created for the file.
Since:
1.22

createDocument

public IndexDocument createDocument(Indexable indexable)
Creates a new IndexDocument.

Returns:
the decument

addDocument

public void addDocument(IndexDocument document)
Adds a new IndexDocument into the index

Parameters:
document - to be added

removeDocuments

public void removeDocuments(Indexable indexable)
Removes all documents for given indexables

Parameters:
indexable - to be removed

markDirtyDocuments

public void markDirtyDocuments(Indexable indexable)
Marks all documents for an Indexable as dirty. Any subsequent use of QuerySupport for those Indexables will first refresh the documents (ie. call indexers) to make sure that the documents are up-to-date.

Parameters:
indexable - The Indexable whose documents will be marked as dirty.
Since:
1.4

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

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