|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IndexingContext
Context for an indexing operation. By default, the context contains the URL of the file currently being indexed, as well as a text buffer containing the contents of the file. Indexer
implementations can store additional items in the context to be shared with other indexers. For example, an indexer might run a lexer on the file contents and store the tokens in the context. Another indexer could then reuse these tokens without running another lexer. This is done by calling the get(java.lang.String)
and put(java.lang.String, java.lang.Object)
methods.
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String key) Get the context item with the given key. |
java.lang.Object |
getFilterKey() Get the key being used to filter results. |
java.lang.Object |
getFilterValue() Get the value used to filter results. |
Node |
getNode() Get the Node being indexed. |
Project |
getProject() Get the project being indexed. |
TextBuffer |
getTextBuffer() Get the text buffer containing the contents of the file being indexed. |
long |
getTimestamp() Get the time stamp of the file being indexed. |
java.net.URL |
getURL() Get the URL of the file being indexed. |
void |
put(java.lang.String key, java.lang.Object item) Add a context item with the given key. |
Method Detail |
---|
Project getProject()
Node getNode()
Indexer.index(oracle.ide.index.IndexingContext, oracle.ide.index.DataCollector)
. The return value is undefined during Indexer.startIndexing(oracle.ide.index.IndexingContext)
and Indexer.endIndexing(oracle.ide.index.IndexingContext)
.
Important Note: this method is provided only to provide contextual information to the Indexer
. The Indexer
implementation must not take any locks on the Node
. Doing so could lead to deadlock between the indexing thread and threads waiting for an index query result while holding a lock. The Indexer
must use the buffer returned by getTextBuffer()
to access the contents of the Node
.
The only exception to this is when the Node
being indexed is not a TextNode
. In that case, the Node
will be read locked at the time the Indexer.index(oracle.ide.index.IndexingContext, oracle.ide.index.DataCollector)
method is called, so the implementation can directly access the Node
contents.
java.net.URL getURL()
Indexer.index(oracle.ide.index.IndexingContext, oracle.ide.index.DataCollector)
. The return value is undefined during Indexer.startIndexing(oracle.ide.index.IndexingContext)
and Indexer.endIndexing(oracle.ide.index.IndexingContext)
.TextBuffer getTextBuffer()
Indexer.index(oracle.ide.index.IndexingContext, oracle.ide.index.DataCollector)
is called. This is only available during Indexer.index(oracle.ide.index.IndexingContext, oracle.ide.index.DataCollector)
. The return value is undefined during Indexer.startIndexing(oracle.ide.index.IndexingContext)
and Indexer.endIndexing(oracle.ide.index.IndexingContext)
. If the node being indexed is not a TextNode
, this will return null
.long getTimestamp()
Indexer.index(oracle.ide.index.IndexingContext, oracle.ide.index.DataCollector)
. The return value is undefined during Indexer.startIndexing(oracle.ide.index.IndexingContext)
and Indexer.endIndexing(oracle.ide.index.IndexingContext)
.java.lang.Object getFilterKey()
java.lang.Object getFilterValue()
getFilterKey()
and the value returned by this method.java.lang.Object get(java.lang.String key)
key
- the keyvoid put(java.lang.String key, java.lang.Object item)
key
- the keyitem
- the context item to be added
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |