1 /*
2 * SPDX-FileCopyrightText: none
3 * SPDX-License-Identifier: CC0-1.0
4 */
5
6 package dev.metaschema.databind.codegen;
7
8 import dev.metaschema.core.model.IModule;
9 import dev.metaschema.core.model.MetaschemaException;
10 import dev.metaschema.databind.model.IBoundModule;
11 import edu.umd.cs.findbugs.annotations.NonNull;
12
13 /**
14 * A functional interface for generating bound Java classes from a Metaschema
15 * module.
16 * <p>
17 * Implementations of this interface are responsible for generating, compiling,
18 * and loading Java classes that represent the module and its definitions.
19 */
20 @FunctionalInterface
21 public interface IModuleBindingGenerator {
22 /**
23 * Generate bound Java classes for the provided Metaschema module.
24 *
25 * @param module
26 * the Metaschema module to generate classes for
27 * @return the generated bound module class
28 * @throws MetaschemaException
29 * if an error occurs during generation or compilation
30 */
31 @NonNull
32 Class<? extends IBoundModule> generate(@NonNull IModule module) throws MetaschemaException;
33 }