io.vertigo.studio.tools.StudioConfigYamlParser Maven / Gradle / Ivy
/**
* vertigo - application development platform
*
* Copyright (C) 2013-2022, Vertigo.io, [email protected]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.vertigo.studio.tools;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;
import io.vertigo.core.lang.Assertion;
import io.vertigo.core.util.FileUtil;
import io.vertigo.core.util.StringUtil;
import io.vertigo.studio.generator.GeneratorConfig;
import io.vertigo.studio.generator.GeneratorConfigBuilder;
import io.vertigo.studio.notebook.NotebookConfig;
import io.vertigo.studio.source.Source;
import io.vertigo.studio.tools.YamlStudioConfig.YamlMdaConfig;
import io.vertigo.studio.tools.YamlStudioConfig.YamlResourceConfig;
final class StudioConfigYamlParser {
static final NotebookConfig parseYaml(final URL configUrl) throws URISyntaxException {
final YamlStudioConfig yamlStudioConfig = new Yaml(new Constructor(YamlStudioConfig.class)).loadAs(FileUtil.read(configUrl), YamlStudioConfig.class);
final String rootPath = Path.of(configUrl.toURI()).getParent().toString() + "/";
//metamodelresources
final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy