use of org.drools.compiler.lang.descr.CompositePackageDescr in project drools by kiegroup.
the class ModelBuilderImpl method storeGeneratedPojosInPackages.
private void storeGeneratedPojosInPackages(Collection<CompositePackageDescr> packages) {
Collection<GeneratedClassWithPackage> allGeneratedPojos = ((CanonicalModelBuildContext) getBuildContext()).getAllGeneratedPojos();
Map<String, Class<?>> allCompiledClasses = ((CanonicalModelBuildContext) getBuildContext()).getAllCompiledClasses();
for (CompositePackageDescr packageDescr : packages) {
InternalKnowledgePackage pkg = getPackageRegistry(packageDescr.getNamespace()).getPackage();
allGeneratedPojos.stream().filter(pojo -> isInPackage(pkg, pojo)).forEach(pojo -> registerType(pkg.getTypeResolver(), allCompiledClasses.get(pojo.getFullyQualifiedName())));
}
}
Aggregations