public class ConstraintBuilder
extends java.lang.Object
Constructor and Description |
---|
ConstraintBuilder() |
Modifier and Type | Method and Description |
---|---|
protected static void |
buildConstraint(Expression exp,
BuildContext context,
boolean invert,
IParserHelper helper)
Build a constraint for a single expression.
|
static ICondition |
buildConstraints(Expression expression,
BuildContext context,
IParserHelper helper)
Build or adapt conditions for representing the given constraints.
|
protected static void |
buildOperatorConstraint(Expression left,
Expression right,
IOperator op,
BuildContext context,
IParserHelper helper)
Build an operator constraint.
|
protected static java.util.List |
combineValueSources(java.lang.Object valuesource,
java.util.List suffs)
Combine (i.e.
|
protected static MethodCall |
createMethodCall(OAVJavaType type,
java.lang.String name,
Expression[] paramvalues,
BuildContext context,
IParserHelper helper)
Create a method call.
|
protected static Expression |
flattenToPrimary(Expression value,
BuildContext context,
IParserHelper helper)
Flatten a value to a primary value (literal or variable).
|
protected static java.lang.Object |
getObjectConditionAndValueSource(Expression value,
BuildContext context,
IParserHelper helper)
Find or create an object condition for a value and
return the appropriate value source.
|
protected static void |
shuffle(BuildContext context)
Shuffle conditions and constraints, such that all variables are bound
before used.
|
public static ICondition buildConstraints(Expression expression, BuildContext context, IParserHelper helper)
expression
- The expression, which contains the constraints to represent.context
- The build context.protected static void buildConstraint(Expression exp, BuildContext context, boolean invert, IParserHelper helper)
protected static void buildOperatorConstraint(Expression left, Expression right, IOperator op, BuildContext context, IParserHelper helper)
protected static java.lang.Object getObjectConditionAndValueSource(Expression value, BuildContext context, IParserHelper helper)
value
- The value to be obtained.lcons
- The existing conditions.bcons
- The conditions for existing variables.tmodel
- The type model.protected static MethodCall createMethodCall(OAVJavaType type, java.lang.String name, Expression[] paramvalues, BuildContext context, IParserHelper helper)
type
- The object type.name
- The method name.paramvalues
- The parameter values.context
- The build context.protected static Expression flattenToPrimary(Expression value, BuildContext context, IParserHelper helper)
value
- The value to be obtained.lcons
- The existing conditions.bcons
- The conditions for existing variables.tmodel
- The type model.protected static void shuffle(BuildContext context)
lcons
- The list of conditions (shuffled in place).protected static java.util.List combineValueSources(java.lang.Object valuesource, java.util.List suffs)
valuesource
- The initial value source.suffs
- The suffixes to the initial value source.