Search in sources :

Example 1 with DynamicRegistry

use of io.vertigo.dynamo.plugins.environment.dsl.dynamic.DynamicRegistry in project vertigo by KleeGroup.

the class DynamoDefinitionProvider method parse.

/**
 * @param definitionResourceConfigs List of resources (must be in a type managed by this loader)
 */
private List<DefinitionSupplier> parse(final DefinitionSpace definitionSpace) {
    // Création du repositoy des instances le la grammaire (=> model)
    final DynamicRegistry dynamoDynamicRegistry = new DynamoDynamicRegistry();
    final DslDefinitionRepository dslDefinitionRepository = new DslDefinitionRepository(dynamoDynamicRegistry);
    // --Enregistrement des types primitifs
    for (final DslDefinition dslDefinition : dynamoDynamicRegistry.getGrammar().getRootDefinitions()) {
        dslDefinitionRepository.addDefinition(dslDefinition);
    }
    for (final DefinitionResourceConfig definitionResourceConfig : definitionResourceConfigs) {
        final Loader loaderPlugin = loadersByType.get(definitionResourceConfig.getType());
        Assertion.checkNotNull(loaderPlugin, "This resource {0} can not be parse by these loaders : {1}", definitionResourceConfig, loadersByType.keySet());
        loaderPlugin.load(definitionResourceConfig.getPath(), dslDefinitionRepository);
    }
    return dslDefinitionRepository.solve(definitionSpace);
}
Also used : DslDefinition(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition) DynamoDynamicRegistry(io.vertigo.dynamo.plugins.environment.registries.DynamoDynamicRegistry) DefinitionResourceConfig(io.vertigo.app.config.DefinitionResourceConfig) DynamoDynamicRegistry(io.vertigo.dynamo.plugins.environment.registries.DynamoDynamicRegistry) DynamicRegistry(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DynamicRegistry) AnnotationLoader(io.vertigo.dynamo.plugins.environment.loaders.java.AnnotationLoader) Loader(io.vertigo.dynamo.plugins.environment.loaders.Loader) EAXmiLoader(io.vertigo.dynamo.plugins.environment.loaders.eaxmi.core.EAXmiLoader) OOMLoader(io.vertigo.dynamo.plugins.environment.loaders.poweramc.core.OOMLoader) KprLoader(io.vertigo.dynamo.plugins.environment.loaders.kpr.KprLoader) DslDefinitionRepository(io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinitionRepository)

Aggregations

DefinitionResourceConfig (io.vertigo.app.config.DefinitionResourceConfig)1 DslDefinition (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinition)1 DslDefinitionRepository (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DslDefinitionRepository)1 DynamicRegistry (io.vertigo.dynamo.plugins.environment.dsl.dynamic.DynamicRegistry)1 Loader (io.vertigo.dynamo.plugins.environment.loaders.Loader)1 EAXmiLoader (io.vertigo.dynamo.plugins.environment.loaders.eaxmi.core.EAXmiLoader)1 AnnotationLoader (io.vertigo.dynamo.plugins.environment.loaders.java.AnnotationLoader)1 KprLoader (io.vertigo.dynamo.plugins.environment.loaders.kpr.KprLoader)1 OOMLoader (io.vertigo.dynamo.plugins.environment.loaders.poweramc.core.OOMLoader)1 DynamoDynamicRegistry (io.vertigo.dynamo.plugins.environment.registries.DynamoDynamicRegistry)1