Class ConstraintParser
java.lang.Object
org.drools.model.codegen.execmodel.generator.drlxparse.ConstraintParser
Parses the MVEL String Constraint and compiles it to a Java Expression
There are two kinds of ConstraintParser
ConstraintParser#defaultConstraintParser
ConstraintParser#withoutVariableValidation
There are some cases (such as from, eval) in which variables are allowed in the constraint
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConstraintParserdefaultConstraintParser(RuleContext context, PackageModel packageModel) drlxParse(Class<?> patternType, String bindingId, ConstraintExpression constraint, boolean isPositional) static TypedExpressiongetCoercedRightExpression(PackageModel packageModel, CoercedExpression.CoercedExpressionResult coerced) static booleanisArithmeticOperator(com.github.javaparser.ast.expr.BinaryExpr.Operator operator) static com.github.javaparser.ast.expr.ExpressiontoBigDecimalExpression(TypedExpression typedExpression, RuleContext context) static ConstraintParserwithoutVariableValidationConstraintParser(RuleContext context, PackageModel packageModel)
-
Method Details
-
defaultConstraintParser
public static ConstraintParser defaultConstraintParser(RuleContext context, PackageModel packageModel) -
withoutVariableValidationConstraintParser
public static ConstraintParser withoutVariableValidationConstraintParser(RuleContext context, PackageModel packageModel) -
drlxParse
-
drlxParse
public DrlxParseResult drlxParse(Class<?> patternType, String bindingId, String expression, boolean isPositional) -
drlxParse
public DrlxParseResult drlxParse(Class<?> patternType, String bindingId, ConstraintExpression constraint, boolean isPositional) -
getCoercedRightExpression
public static TypedExpression getCoercedRightExpression(PackageModel packageModel, CoercedExpression.CoercedExpressionResult coerced) -
toBigDecimalExpression
public static com.github.javaparser.ast.expr.Expression toBigDecimalExpression(TypedExpression typedExpression, RuleContext context) -
isArithmeticOperator
public static boolean isArithmeticOperator(com.github.javaparser.ast.expr.BinaryExpr.Operator operator)
-