Search in sources :

Example 1 with ModuleLoader

use of org.opt4j.core.config.ModuleLoader in project opt4j by felixreimann.

the class FileOperations method load.

/**
 * Loads the selected modules from the specified file.
 *
 * @param file
 *            the configuration file
 */
public void load(File file) {
    setFile(file);
    selectedModules.clear();
    ModuleLoader loader = new ModuleLoader(moduleRegister);
    Collection<? extends Module> modules = loader.load(file);
    for (Module module : modules) {
        PropertyModule m = new PropertyModule(module);
        selectedModules.add(m);
    }
    System.out.println("Loaded configuration from " + file);
}
Also used : ModuleLoader(org.opt4j.core.config.ModuleLoader) PropertyModule(org.opt4j.core.config.PropertyModule) Module(com.google.inject.Module) PropertyModule(org.opt4j.core.config.PropertyModule)

Aggregations

Module (com.google.inject.Module)1 ModuleLoader (org.opt4j.core.config.ModuleLoader)1 PropertyModule (org.opt4j.core.config.PropertyModule)1