|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMatchExpression<T>
A match expression is a boolean expression matching a candidate of a
specific type. An IEvaluationContext
is needed in order to evaluate
a match and this class provides two ways of doing that. Either a context
is created first and then reused in several subsequent calls to
isMatch(IEvaluationContext, Object)
or, if no repeated calls are
expected, the isMatch(Object)
method can be used. It will then
create a context on each call.
Field Summary |
---|
Fields inherited from interface org.eclipse.equinox.p2.metadata.expression.IExpression |
---|
TYPE_ALL, TYPE_AND, TYPE_ARRAY, TYPE_ASSIGNMENT, TYPE_AT, TYPE_COLLECT, TYPE_CONDITION, TYPE_EQUALS, TYPE_EXISTS, TYPE_FIRST, TYPE_FLATTEN, TYPE_FUNCTION, TYPE_GREATER, TYPE_GREATER_EQUAL, TYPE_INTERSECT, TYPE_LAMBDA, TYPE_LATEST, TYPE_LESS, TYPE_LESS_EQUAL, TYPE_LIMIT, TYPE_LITERAL, TYPE_MATCHES, TYPE_MEMBER, TYPE_NOT, TYPE_NOT_EQUALS, TYPE_OR, TYPE_PARAMETER, TYPE_PIPE, TYPE_SELECT, TYPE_TRAVERSE, TYPE_UNION, TYPE_UNIQUE, TYPE_VARIABLE |
Method Summary | |
---|---|
IEvaluationContext |
createContext()
Creates a new context to be passed to repeated subsequent evaluations. |
Object[] |
getParameters()
Returns the parameters that this match expression was created with. |
boolean |
isMatch(IEvaluationContext context,
T candidate)
This method assigns candidate to the 'this' variable of the
context and then evaluates the expression. |
boolean |
isMatch(T candidate)
This method creates a new evaluation context and assigns the candidate
to the 'this' variable of the context and then evaluates the expression. |
Methods inherited from interface org.eclipse.equinox.p2.metadata.expression.IExpression |
---|
accept, evaluate, getExpressionType, toLDAPString, toString |
Method Detail |
---|
IEvaluationContext createContext()
Creates a new context to be passed to repeated subsequent evaluations. The context will introduce 'this' as an uninitialized variable and make the parameters available.
Object[] getParameters()
null
.boolean isMatch(T candidate)
candidate
to the 'this' variable of the context
and then evaluates the expression.
This is essentially a short form for isMatch(createContext(), candidate).
candidate
- The object to test.
boolean isMatch(IEvaluationContext context, T candidate)
candidate
to the 'this' variable of the
context
and then evaluates the expression.
context
- A contextcandidate
- The object to test.
|
Eclipse Platform Release 3.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.