private <T extends Enum<T>> void addStandardModuleWithOptions(GeneratorModule module, SchemaGeneratorConfigBuilder configBuilder,
            Function<T[], Module> moduleConstructor, Class<T> optionType) throws MojoExecutionException {
        Stream.Builder<T> optionStream = Stream.builder();
        for (String optionName : Util.nullSafe(module.options)) {
            try {
                optionStream.add(Enum.valueOf(optionType, optionName));
            } catch (IllegalArgumentException e) {
                throw new MojoExecutionException("Error: Unknown " + module.name + " option " + optionName, e);
            }
        }
        T[] options = optionStream.build().toArray(count -> (T[]) Array.newInstance(optionType, count));
        configBuilder.with(moduleConstructor.apply(options));
    }
Add a standard module to the generator configuration.

@param <T> type of option enum the standard module expects in its constructor
@param configBuilder builder on which the standard module should be added
@param module record in the modules section from the pom
@param moduleConstructor module constructor expecting an array of options
@param optionType enum type for the module options (e.g., JacksonOption or JakartaValidationOption)
@throws MojoExecutionException in case of problems
jsonschema-maven-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java