use of io.vertigo.dynamo.plugins.environment.registries.DynamoDynamicRegistry 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);
}
Aggregations