Package | Description |
---|---|
org.eclipse.equinox.p2.metadata.expression |
Provides a simple expression language used to represent requirements and filters in the metadada
Package Specification
This package defines a simple expression language that is used to define requirements and filters in the metadata, but also form the base of the p2 query language.
|
org.eclipse.equinox.p2.metadata.index |
Provides classes for metadata query indexing
Package Specification
This package provides API for creating and manipulating indices that are used
to optimize queries against a particular queryable source.
|
org.eclipse.equinox.p2.ql |
A query language specialized in the querying of p2 constructs.
|
org.eclipse.equinox.p2.query |
Provides common classes for the query mechanism.
|
Modifier and Type | Interface and Description |
---|---|
interface |
IContextExpression<T>
This is an expression that will need access to the global variable
everything . |
interface |
IFilterExpression
An interface that combines the IExpression with the LDAP filter.
|
interface |
IMatchExpression<T>
A match expression is a boolean expression matching a candidate of a
specific type.
|
Modifier and Type | Field and Description |
---|---|
static IExpression |
ExpressionUtil.FALSE_EXPRESSION |
static IExpression[] |
IExpressionFactory.NO_ARGS |
static IExpression |
ExpressionUtil.TRUE_EXPRESSION |
Modifier and Type | Method and Description |
---|---|
IExpression |
IExpressionFactory.all(IExpression collection,
IExpression lambda)
Create a collection filter that yields true if the
lambda yields true for
all of the elements of the collection |
IExpression |
IExpressionFactory.and(IExpression... operands)
Create a logical and of its
operands . |
IExpression |
IExpressionFactory.array(IExpression... elements)
Create an array of elements.
|
IExpression |
IExpressionFactory.assignment(IExpression variable,
IExpression expression)
Creates an expression that represents a variable assignment
|
IExpression |
IExpressionFactory.at(IExpression target,
IExpression key)
Create an lookup of
key in the target . |
IExpression |
IExpressionFactory.collect(IExpression collection,
IExpression lambda)
Create an expression that collects the result of evaluating each element in a new collection.
|
IExpression |
IExpressionFactory.condition(IExpression test,
IExpression ifTrue,
IExpression ifFalse)
Create an expression that first evaluates a
test and then, depending on the outcome,
evaluates either ifTrue or ifFalse . |
IExpression |
IExpressionFactory.constant(Object value)
Creates an expression that evaluates to the constant
value . |
IExpression |
IExpressionFactory.equals(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is equal to rhs . |
IExpression |
IExpressionFactory.exists(IExpression collection,
IExpression lambda)
Create a collection filter that yields true if the
lambda yields true for
at least one of the elements of the collection |
IExpression |
IExpressionFactory.first(IExpression collection,
IExpression lambda)
Create an expression that yields the first element of the
collection for which the lambda yields true . |
IExpression |
IExpressionFactory.flatten(IExpression collection)
Intended to be applied on collections of collections.
|
IExpression |
IExpressionFactory.function(Object function,
IExpression... args)
Given one of the values in the map returned by
IExpressionFactory.getFunctionMap() , this method
returns a function expression. |
static IExpression |
ExpressionUtil.getLHS(IExpression expression)
Obtains the Left Hand Side (LHS) of a binary expression.
|
static IExpression |
ExpressionUtil.getOperand(IExpression expression)
Obtains the operand of an unary expression
|
static IExpression[] |
ExpressionUtil.getOperands(IExpression expression)
Obtains the operands of an n-ary expression
|
static IExpression |
ExpressionUtil.getRHS(IExpression expression)
Obtains the Right Hand Side (RHS) of a binary expression.
|
IExpression |
IExpressionFactory.greater(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is greater than rhs . |
IExpression |
IExpressionFactory.greaterEqual(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is greater than or equal to rhs . |
IExpression |
IExpressionFactory.indexedParameter(int index)
Creates an indexed parameter expression
|
IExpression |
IExpressionFactory.intersect(IExpression c1,
IExpression c2)
Create an intersection of
c1 and c2 |
IExpression |
IExpressionFactory.lambda(IExpression variable,
IExpression body)
Creates a lambda expression that takes exactly one variable.
|
IExpression |
IExpressionFactory.lambda(IExpression variable,
IExpression[] initialAssignments,
IExpression body)
Creates a lambda expression that takes more then one variable (currying).
|
IExpression |
IExpressionFactory.latest(IExpression collection)
Create an expression that yields a new collection consisting of the latest version of
the elements of the
collection . |
IExpression |
IExpressionFactory.less(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is less than rhs . |
IExpression |
IExpressionFactory.lessEqual(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is less than or equal to rhs . |
IExpression |
IExpressionFactory.limit(IExpression collection,
IExpression limit)
Create an expression that yields a new collection consisting of the n first
elements of the source collection where n is determined by
limit . |
IExpression |
IExpressionFactory.limit(IExpression collection,
int count)
Create an expression that yields a new collection consisting of the count
first elements of the source collection.
|
IExpression |
IExpressionFactory.matches(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs matches rhs . |
IExpression |
IExpressionFactory.member(IExpression target,
String name)
Creates a member accessor expression.
|
IExpression |
IExpressionFactory.memberCall(IExpression target,
String name,
IExpression... args)
Creates a member call expression.
|
IExpression |
IExpressionFactory.normalize(List<? extends IExpression> operands,
int expressionType)
Performs boolean normalization on the expression to create a canonical form.
|
IExpression |
IExpressionFactory.not(IExpression operand)
Creates an expression that negates the result of evaluating its
operand . |
IExpression |
IExpressionFactory.or(IExpression... operands)
Create a logical or of its
operands . |
static IExpression |
ExpressionUtil.parse(String expression)
Create a new expression.
|
IExpression |
IExpressionParser.parse(String exprString)
Create a new expression.
|
static IExpression |
ExpressionUtil.parseQuery(String expression)
Create an arbitrary expression.
|
IExpression |
IExpressionParser.parseQuery(String exprString)
Create an arbitrary expression.
|
IExpression |
IExpressionFactory.pipe(IExpression... expressions)
Create a pipe of expressions.
|
IExpression |
IExpressionFactory.select(IExpression collection,
IExpression lambda)
Create an expression that yields a new collection consisting of all elements of the
collection for which the lambda yields true . |
IExpression |
IExpressionFactory.thisVariable()
Returns the variable that represents
this in an expression |
IExpression |
IExpressionFactory.toExpression(IQuery<?> query)
Wrap an
IQuery as an expression. |
IExpression |
IExpressionFactory.traverse(IExpression collection,
IExpression lambda)
Recursively traverse and collect elements based on a condition
A common scenario in p2 is that you want to start with a set of roots and then find
all items that fulfill the root requirements.
|
IExpression |
IExpressionFactory.union(IExpression c1,
IExpression c2)
Create a union of
c1 and c2 |
IExpression |
IExpressionFactory.unique(IExpression collection,
IExpression cache)
Create an expression that yields a new collection where each element is unique.
|
IExpression |
IExpressionFactory.variable(String name)
Creates an expression that represents a variable
|
Modifier and Type | Method and Description |
---|---|
IExpression |
IExpressionFactory.all(IExpression collection,
IExpression lambda)
Create a collection filter that yields true if the
lambda yields true for
all of the elements of the collection |
IExpression |
IExpressionFactory.and(IExpression... operands)
Create a logical and of its
operands . |
IExpression |
IExpressionFactory.array(IExpression... elements)
Create an array of elements.
|
IExpression |
IExpressionFactory.assignment(IExpression variable,
IExpression expression)
Creates an expression that represents a variable assignment
|
IExpression |
IExpressionFactory.at(IExpression target,
IExpression key)
Create an lookup of
key in the target . |
IExpression |
IExpressionFactory.collect(IExpression collection,
IExpression lambda)
Create an expression that collects the result of evaluating each element in a new collection.
|
IExpression |
IExpressionFactory.condition(IExpression test,
IExpression ifTrue,
IExpression ifFalse)
Create an expression that first evaluates a
test and then, depending on the outcome,
evaluates either ifTrue or ifFalse . |
<T> IContextExpression<T> |
IExpressionFactory.contextExpression(IExpression expr,
Object... parameters)
Creates a top level expression that represents a full query.
|
IEvaluationContext |
IExpressionFactory.createContext(IExpression[] variables,
Object... params)
Create an evaluation context with one single variable
|
IExpression |
IExpressionFactory.equals(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is equal to rhs . |
IExpression |
IExpressionFactory.exists(IExpression collection,
IExpression lambda)
Create a collection filter that yields true if the
lambda yields true for
at least one of the elements of the collection |
IFilterExpression |
IExpressionFactory.filterExpression(IExpression expression)
Creates a top level expression suitable for predicate matching
|
IExpression |
IExpressionFactory.first(IExpression collection,
IExpression lambda)
Create an expression that yields the first element of the
collection for which the lambda yields true . |
IExpression |
IExpressionFactory.flatten(IExpression collection)
Intended to be applied on collections of collections.
|
IExpression |
IExpressionFactory.function(Object function,
IExpression... args)
Given one of the values in the map returned by
IExpressionFactory.getFunctionMap() , this method
returns a function expression. |
static IExpression |
ExpressionUtil.getLHS(IExpression expression)
Obtains the Left Hand Side (LHS) of a binary expression.
|
static String |
ExpressionUtil.getName(IExpression expression)
Obtains the name of a variable or member expression.
|
static IExpression |
ExpressionUtil.getOperand(IExpression expression)
Obtains the operand of an unary expression
|
static IExpression[] |
ExpressionUtil.getOperands(IExpression expression)
Obtains the operands of an n-ary expression
|
static IExpression |
ExpressionUtil.getRHS(IExpression expression)
Obtains the Right Hand Side (RHS) of a binary expression.
|
static Object |
ExpressionUtil.getValue(IExpression expression)
Obtains the value of a literal expression
|
Object |
IEvaluationContext.getValue(IExpression variable)
Retrieve the value of the given
variable from this context |
IExpression |
IExpressionFactory.greater(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is greater than rhs . |
IExpression |
IExpressionFactory.greaterEqual(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is greater than or equal to rhs . |
IExpression |
IExpressionFactory.intersect(IExpression c1,
IExpression c2)
Create an intersection of
c1 and c2 |
IExpression |
IExpressionFactory.lambda(IExpression variable,
IExpression body)
Creates a lambda expression that takes exactly one variable.
|
IExpression |
IExpressionFactory.lambda(IExpression variable,
IExpression[] initialAssignments,
IExpression body)
Creates a lambda expression that takes more then one variable (currying).
|
IExpression |
IExpressionFactory.lambda(IExpression variable,
IExpression[] initialAssignments,
IExpression body)
Creates a lambda expression that takes more then one variable (currying).
|
IExpression |
IExpressionFactory.latest(IExpression collection)
Create an expression that yields a new collection consisting of the latest version of
the elements of the
collection . |
IExpression |
IExpressionFactory.less(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is less than rhs . |
IExpression |
IExpressionFactory.lessEqual(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs is less than or equal to rhs . |
IExpression |
IExpressionFactory.limit(IExpression collection,
IExpression limit)
Create an expression that yields a new collection consisting of the n first
elements of the source collection where n is determined by
limit . |
IExpression |
IExpressionFactory.limit(IExpression collection,
int count)
Create an expression that yields a new collection consisting of the count
first elements of the source collection.
|
IExpression |
IExpressionFactory.matches(IExpression lhs,
IExpression rhs)
Create an expression that tests if
lhs matches rhs . |
<T> IMatchExpression<T> |
IExpressionFactory.matchExpression(IExpression expression,
Object... parameters)
Creates a parameterized top level expression suitable for predicate matching
|
IExpression |
IExpressionFactory.member(IExpression target,
String name)
Creates a member accessor expression.
|
IExpression |
IExpressionFactory.memberCall(IExpression target,
String name,
IExpression... args)
Creates a member call expression.
|
IExpression |
IExpressionFactory.memberCall(IExpression target,
String name,
IExpression... args)
Creates a member call expression.
|
IExpression |
IExpressionFactory.not(IExpression operand)
Creates an expression that negates the result of evaluating its
operand . |
IExpression |
IExpressionFactory.or(IExpression... operands)
Create a logical or of its
operands . |
IExpression |
IExpressionFactory.pipe(IExpression... expressions)
Create a pipe of expressions.
|
IExpression |
IExpressionFactory.select(IExpression collection,
IExpression lambda)
Create an expression that yields a new collection consisting of all elements of the
collection for which the lambda yields true . |
void |
IEvaluationContext.setValue(IExpression variable,
Object value)
Set the current value for the given
variable to value |
IExpression |
IExpressionFactory.traverse(IExpression collection,
IExpression lambda)
Recursively traverse and collect elements based on a condition
A common scenario in p2 is that you want to start with a set of roots and then find
all items that fulfill the root requirements.
|
IExpression |
IExpressionFactory.union(IExpression c1,
IExpression c2)
Create a union of
c1 and c2 |
IExpression |
IExpressionFactory.unique(IExpression collection,
IExpression cache)
Create an expression that yields a new collection where each element is unique.
|
boolean |
IExpressionVisitor.visit(IExpression expression)
The method that will be called for each expression that is
visited.
|
Modifier and Type | Method and Description |
---|---|
IExpression |
IExpressionFactory.normalize(List<? extends IExpression> operands,
int expressionType)
Performs boolean normalization on the expression to create a canonical form.
|
Modifier and Type | Method and Description |
---|---|
Iterator<T> |
IIndex.getCandidates(IEvaluationContext ctx,
IExpression variable,
IExpression booleanExpr)
Obtains the elements that are candidates for the given
booleanExpr when applied
using the given variable as this . |
Modifier and Type | Interface and Description |
---|---|
interface |
IQLExpression |
Modifier and Type | Method and Description |
---|---|
IExpression |
MatchQuery.getExpression()
Deprecated.
|
IExpression |
IQuery.getExpression()
Returns the IExpression backing this query or
null if
this is not an expression query. |
Modifier and Type | Method and Description |
---|---|
static <T> IQuery<T> |
QueryUtil.createMatchQuery(Class<? extends T> matchingClass,
IExpression matchExpression,
Object... parameters)
Creates an query that will iterate over all candidates and discriminate all
candidates that are not instances of
matchinClass> or for which
the boolean matchExpression returns false. |
static IQuery<IInstallableUnit> |
QueryUtil.createMatchQuery(IExpression matchExpression,
Object... parameters)
Creates an
IInstallableUnit query that will iterate over all candidates and discriminate by
applying the boolean matchExpression on each candidate. |
static <T> IQuery<T> |
QueryUtil.createQuery(Class<? extends T> matchingClass,
IExpression expression,
Object... parameters)
Creates a query that will limit the result to instances of the
matchinClass . |
static IQuery<IInstallableUnit> |
QueryUtil.createQuery(IExpression expression,
Object... parameters)
Creates an
IInstallableUnit query based on an expression that
uses all candidates as input. |
Constructor and Description |
---|
ExpressionMatchQuery(Class<? extends T> matchingClass,
IExpression expression,
Object... parameters) |
ExpressionQuery(Class<? extends T> elementClass,
IExpression expression,
Object... parameters) |
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.