DeclaredTypeCodegen extends AbstractGenerator { public static DeclaredTypeCodegen ofPath(Path basePath) { try { Stream<File> files = Files.walk(basePath).map(Path::toFile); Set<Resource> resources = toResources(files); return new DeclaredTypeCodegen(resources); } catch (IOException e) { throw new UncheckedIOException(e); } } private  DeclaredTypeCodegen(Collection<Resource> resources); static DeclaredTypeCodegen ofPath(Path basePath); static DeclaredTypeCodegen ofFiles(Collection<File> files); static DeclaredTypeCodegen ofResources(Collection<Resource> resources); @Override void setPackageName(String packageName); void setDependencyInjection(DependencyInjectionAnnotator annotator); @Override ApplicationSection section(); List<org.kie.kogito.codegen.GeneratedFile> generate(); @Override void updateConfig(ConfigGenerator cfg); DeclaredTypeCodegen withClassLoader(ClassLoader projectClassLoader);  }
@Test void ofPath() { DeclaredTypeCodegen incrementalRuleCodegen = DeclaredTypeCodegen.ofFiles( Collections.singleton( new File("src/test/resources/org/kie/kogito/codegen/declared/declared.drl"))); incrementalRuleCodegen.setPackageName("com.acme"); List<GeneratedFile> generatedFiles = incrementalRuleCodegen.generate(); assertThat(generatedFiles).hasSize(1); }