Class ExplicitCanonicalModelCompiler<T extends PackageSources>

  • Type Parameters:
    T - a subclass of PackageSources to retrieve the generated results

    public class ExplicitCanonicalModelCompiler<T extends PackageSources>
    extends java.lang.Object
    An alternative compilation flow that generates code starting from a collection of CompositePackageDescrs, skipping the KnowledgeBuilder entirely. It explicitly invokes the necessary CompilationPhases one after the other and collects the error.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExplicitCanonicalModelCompiler​(java.util.Collection<org.drools.compiler.lang.descr.CompositePackageDescr> packages, org.drools.compiler.builder.PackageRegistryManager pkgRegistryManager, PackageModelManager packageModelManager, CanonicalModelBuildContext buildContext, org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl configuration, org.drools.compiler.builder.impl.BuildResultCollector results, org.drools.compiler.builder.impl.TypeDeclarationContext typeDeclarationContext, org.drools.compiler.builder.impl.GlobalVariableContext globalVariableContext, PackageSourceManager<T> packageSourceManager, java.util.function.Function<PackageModel,​T> sourceDumpFunction)  
    • Constructor Detail

      • ExplicitCanonicalModelCompiler

        public ExplicitCanonicalModelCompiler​(java.util.Collection<org.drools.compiler.lang.descr.CompositePackageDescr> packages,
                                              org.drools.compiler.builder.PackageRegistryManager pkgRegistryManager,
                                              PackageModelManager packageModelManager,
                                              CanonicalModelBuildContext buildContext,
                                              org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl configuration,
                                              org.drools.compiler.builder.impl.BuildResultCollector results,
                                              org.drools.compiler.builder.impl.TypeDeclarationContext typeDeclarationContext,
                                              org.drools.compiler.builder.impl.GlobalVariableContext globalVariableContext,
                                              PackageSourceManager<T> packageSourceManager,
                                              java.util.function.Function<PackageModel,​T> sourceDumpFunction)
    • Method Detail

      • of

        public static <T extends PackageSourcesExplicitCanonicalModelCompiler<T> of​(java.util.Collection<org.drools.compiler.lang.descr.CompositePackageDescr> packages,
                                                                                      org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl configuration,
                                                                                      java.util.function.Function<PackageModel,​T> sourceDumpFunction)
      • process

        public void process()
      • getBuildResults

        public org.drools.compiler.builder.impl.BuildResultCollector getBuildResults()
      • getPackageSources

        public java.util.Collection<T> getPackageSources()