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

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

java.lang.Object
  extended by org.netbeans.modules.parsing.spi.indexing.SourceIndexerFactory
Direct Known Subclasses:
CustomIndexerFactory, EmbeddingIndexerFactory

public abstract class SourceIndexerFactory
extends Object

Abstract predecessor of the CustomIndexerFactory and EmbeddingIndexerFactory. The indexer factory should never subclass this class. It should always subclass either the CustomIndexerFactory or EmbeddingIndexerFactory

The IndexingSupport can be used to implement the SourceIndexerFactory

Since:
1.20

Constructor Summary
SourceIndexerFactory()
           
 
Method Summary
abstract  void filesDeleted(Iterable<? extends Indexable> deleted, Context context)
          Called by indexing infrastructure to allow indexer to clean indexes for deleted files.
abstract  void filesDirty(Iterable<? extends Indexable> dirty, Context context)
          Called by indexing infrastructure to notify indexer that a file was modified and so its index may contain stale data.
abstract  String getIndexerName()
          Return the name of this indexer.
abstract  int getIndexVersion()
          Return the version stamp of the schema that is currently being stored by this indexer.
 void rootsRemoved(Iterable<? extends URL> removedRoots)
          Called by indexing infrastructure to notify indexer that roots were deregistered, for example the project owning these roots was closed.
 void scanFinished(Context context)
          Notifies the indexer that scanning of a source root just finished.
 boolean scanStarted(Context context)
          Notifies the indexer that a source root is going to be scanned.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceIndexerFactory

public SourceIndexerFactory()
Method Detail

scanStarted

public boolean scanStarted(Context context)
Notifies the indexer that a source root is going to be scanned.

Parameters:
context - The indexed source root.
Returns:
false means that the whole root should be rescanned (eg. no up to date check is done, etc)

If the IndexingSupport is used to implement the SourceIndexerFactory the implementation of this method should delegate to IndexingSupport.isValid()

Since:
1.20

scanFinished

public void scanFinished(Context context)
Notifies the indexer that scanning of a source root just finished.

Parameters:
context - The indexed source root.
Since:
1.20

filesDeleted

public abstract void filesDeleted(Iterable<? extends Indexable> deleted,
                                  Context context)
Called by indexing infrastructure to allow indexer to clean indexes for deleted files.

Parameters:
deleted - the collection of deleted Indexables
contents - an indexing context

If the IndexingSupport is used to implement the SourceIndexerFactory the implementation of this method should delegate to IndexingSupport.isValid()

Since:
1.18

rootsRemoved

public void rootsRemoved(Iterable<? extends URL> removedRoots)
Called by indexing infrastructure to notify indexer that roots were deregistered, for example the project owning these roots was closed. The indexer may free memory caches for given roots or do any other clean up.

Parameters:
removedRoots - the iterable of removed roots

If the IndexingSupport is used to implement the SourceIndexerFactory the implementation of this method should delegate to IndexingSupport.removeDocuments(org.netbeans.modules.parsing.spi.indexing.Indexable)

Since:
1.19

filesDirty

public abstract void filesDirty(Iterable<? extends Indexable> dirty,
                                Context context)
Called by indexing infrastructure to notify indexer that a file was modified and so its index may contain stale data.

Parameters:
dirty - the collection of dirty Indexables
context - an indexing context

If IndexingSupport is used to implement the SourceIndexerFactory the implementation of this method should delegate to IndexingSupport.markDirtyDocuments(org.netbeans.modules.parsing.spi.indexing.Indexable)

Since:
1.18

getIndexerName

public abstract String getIndexerName()
Return the name of this indexer. This name should be unique because the infrastructure will use this name to produce a separate data directory for each indexer where it has its own storage.

Returns:
The indexer name. This does not need to be localized since it is never shown to the user, but should contain filesystem safe characters.

getIndexVersion

public abstract int getIndexVersion()
Return the version stamp of the schema that is currently being stored by this indexer. Along with the index name this string will be used to create a unique data directory for the database. Whenever you incompatibly change what is stored by the indexer, update the version stamp.

Returns:
The version stamp of the current index.

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

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