Search in sources :

Example 1 with JavaRuleClassBuilder

use of org.drools.compiler.rule.builder.dialect.java.JavaRuleClassBuilder in project drools by kiegroup.

the class LegacyAccumulate method createAllAccumulateClass.

private GeneratedClassWithPackage createAllAccumulateClass(Set<String> imports, String packageName) {
    final String allAccumulatesClass = new JavaRuleClassBuilder().buildRule(ruleBuildContext);
    final CompilationUnit parsedAccumulateClass = JavaParser.parse(allAccumulatesClass);
    return new GeneratedClassWithPackage((ClassOrInterfaceDeclaration) parsedAccumulateClass.getType(0), packageName, imports);
}
Also used : CompilationUnit(org.drools.javaparser.ast.CompilationUnit) GeneratedClassWithPackage(org.drools.modelcompiler.builder.GeneratedClassWithPackage) JavaRuleClassBuilder(org.drools.compiler.rule.builder.dialect.java.JavaRuleClassBuilder)

Aggregations

JavaRuleClassBuilder (org.drools.compiler.rule.builder.dialect.java.JavaRuleClassBuilder)1 CompilationUnit (org.drools.javaparser.ast.CompilationUnit)1 GeneratedClassWithPackage (org.drools.modelcompiler.builder.GeneratedClassWithPackage)1