Class ModelDependencyUpdate


  • public final class ModelDependencyUpdate
    extends Object
    Facility to update dependencies of a model based on its actual content. Doesn't address model access here. Generally, clients shall updateUsedLanguages() first (as it might affect implicit model imports, like language's accessory models), then updateImportedModels(SRepository). Then, if desired and model belongs to a proper module, updateModuleDependencies(SRepository) could bring module's dependencies in the matching state. Nevertheless, methods could be invoked individually according to a task at hand. XXX Likely, shall reside to [smodel], but now depends from [project] (AbstractModule) and [kernel] (ModelImports).
    Since:
    2017.2
    • Constructor Detail

      • ModelDependencyUpdate

        public ModelDependencyUpdate​(@NotNull
                                     SModel model)
    • Method Detail

      • updateImportedModels

        public ModelDependencyUpdate updateImportedModels​(@Nullable
                                                          SRepository languageModuleRepo)
        Updates list of imported models, with respect to models visible through actual list of used languages. It's recommended to updateUsedLanguages() first so that accessory models of used languages are not imported explicitly. Resembles ModelImporter and might be part of ModelImports directly
        Parameters:
        languageModuleRepo - optional repository to resolve accessory models of used languages so that they get imported implicitly. Implementation expects source modules of deployed languages to be resolved in the supplied repository. If no repository supplied, all model imports will be explicit.
      • updateModuleDependencies

        public ModelDependencyUpdate updateModuleDependencies​(@NotNull
                                                              SRepository importsRepo)
        Takes actual list of model imports and propagates these dependencies into model's module dependencies. Works with AbstractModule instances only, and relies on module's scope to decide whether an import is needed. XXX Does pretty much the same what MissingDependenciesFixer does.
        Parameters:
        importsRepo - repository where imported models could get resolved