use of org.drools.modelcompiler.builder.generator.BoxedParameters in project drools by kiegroup.
the class AbstractExpressionBuilder method addIndexedByDeclaration.
protected void addIndexedByDeclaration(TypedExpression left, TypedExpression right, boolean leftContainsThis, MethodCallExpr indexedByDSL, Collection<String> usedDeclarations) {
LambdaExpr indexedByRightOperandExtractor = new LambdaExpr();
BlockStmt lambdaBlock = new BlockStmt();
NodeList<Parameter> parameters = new BoxedParameters(context).getBoxedParametersWithUnboxedAssignment(usedDeclarations, lambdaBlock);
parameters.forEach(indexedByRightOperandExtractor::addParameter);
TypedExpression expression = leftContainsThis ? right : left;
indexedByRightOperandExtractor.setEnclosingParameters(true);
lambdaBlock.addStatement(new ReturnStmt(expression.getExpression()));
indexedByRightOperandExtractor.setBody(lambdaBlock);
indexedByDSL.addArgument(indexedByRightOperandExtractor);
indexedByDSL.addArgument(new ClassExpr(toJavaParserType(expression.getRawClass())));
}
Aggregations