public abstract class QueryExecutorBase<Result,Params> extends java.lang.Object implements QueryExecutor<Result,Params>
QueryExecutor interface which makes it easier to write implementations. It provides a possibility to
automatically wrap the implementation code into a read action. During indexing, query executors that don't implement DumbAware
(but need to be run in a read action), are delayed until indexing is complete, given that search parameters implement DumbAwareSearchParameters.
Besides, processQuery(Object, Processor) doesn't require to return a boolean value and thus it's harder to stop the whole search
by accidentally returning false.Application.runReadAction(Computable),
DumbService| Modifier | Constructor and Description |
|---|---|
protected |
QueryExecutorBase()
Construct an instance that executes
processQuery(Object, Processor) as is, without wrapping into a read action. |
protected |
QueryExecutorBase(boolean requireReadAction) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(Params queryParameters,
Processor<? super Result> consumer)
Find some results according to queryParameters and feed them to consumer.
|
abstract void |
processQuery(Params queryParameters,
Processor<? super Result> consumer)
Find some results according to queryParameters and feed them to consumer.
|
protected QueryExecutorBase(boolean requireReadAction)
requireReadAction - whether processQuery(Object, Processor) should be wrapped into a read action.protected QueryExecutorBase()
processQuery(Object, Processor) as is, without wrapping into a read action.public final boolean execute(Params queryParameters, Processor<? super Result> consumer)
QueryExecutorfalse, stop.execute in interface QueryExecutor<Result,Params>false if the searching should be stopped immediately. This should happen only when consumer has returned false.