use of org.drools.modelcompiler.util.lambdareplace.ExecModelLambdaPostProcessor in project drools by kiegroup.
the class RuleWriter method getRuleSources.
public List<RuleFileSource> getRuleSources() {
List<RuleFileSource> rules = new ArrayList<>();
for (CompilationUnit cu : rulesSource.getModelClasses()) {
final Optional<ClassOrInterfaceDeclaration> classOptional = cu.findFirst(ClassOrInterfaceDeclaration.class);
if (classOptional.isPresent()) {
String addFileName = classOptional.get().getNameAsString();
if (EXTERNALIZE_LAMBDAS && pkgModel.getConfiguration().isExternaliseCanonicalModelLambda()) {
new ExecModelLambdaPostProcessor(pkgModel, cu).convertLambdas();
if (checkNonExternalisedLambda) {
checkNonExternalisedLambda(cu);
}
rules.add(new RuleFileSource(addFileName, cu));
} else {
rules.add(new RuleFileSource(addFileName, cu));
}
}
}
return rules;
}
Aggregations