QueryUtil
or use the QueryUtil.createMatchQuery(String, Object...)
to create a custom expression based query. If the query cannot be expressed using
the p2QL, then use a predefined or custom expression query as a first filter
(in worst case, use QueryUtil.createIUAnyQuery()
) and then provide further filtering
like so:for(iter = queryable.query(someExpressionQuery).iterator(); iter.hasNext();) { // do your match here }
public abstract class MatchQuery<T> extends Object implements IMatchQuery<T>
isMatch(Object)
method in order to write simple
queries against p2 metadata.
Note that hand-written queries cannot be optimized for queryables containing
indices, or for remote queryables. In general you should use one of the pre-defined
queries found in QueryUtil
if possible, to obtain queries optimized for indexing and
remote execution. This class is intended for simple queries against small data
sources where indexed lookup and remote query execution are not needed.
Constructor and Description |
---|
MatchQuery()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
IExpression |
getExpression()
Deprecated.
Returns the IExpression backing this query or
null if
this is not an expression query. |
abstract boolean |
isMatch(T candidate)
Deprecated.
Returns whether the given object satisfies the parameters of this query.
|
IQueryResult<T> |
perform(Iterator<T> iterator)
Deprecated.
Performs this query on the given iterator, passing all objects in the iterator
that match the criteria of this query to the given result.
|
void |
postPerform()
Deprecated.
Execute any post-processing that must be done after this query has been performed against
a particular iterator.
|
void |
prePerform()
Deprecated.
Execute any pre-processing that must be done before this query is performed against
a particular iterator.
|
public abstract boolean isMatch(T candidate)
isMatch
in interface IMatchQuery<T>
candidate
- The object to perform the query againsttrue
if the unit satisfies the parameters
of this query, and false
otherwiseperform(Iterator)
public final IQueryResult<T> perform(Iterator<T> iterator)
public void prePerform()
This method is internal to the framework. Subclasses may override this method, but should not call this method.
public void postPerform()
This method will be called even if the query does not complete successfully.
This method is internal to the framework. Subclasses may override this method, but should not call this method.
public IExpression getExpression()
IQuery
null
if
this is not an expression query.getExpression
in interface IQuery<T>
null
.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.