- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlFile.<init>()
方法的一些代码示例,展示了YamlFile.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlFile.<init>()
方法的具体详情如下:
包路径:uk.gov.dstl.baleen.core.utils.yaml.YamlFile
类名称:YamlFile
方法名:<init>
[英]Read configuration from a file.
[中]从文件中读取配置。
代码示例来源:origin: uk.gov.dstl.baleen/baleen-core
/**
* Construct configuration from raw yaml string.
*
* @param clazz
* @param resourcePath
* @throws Exception
*/
public YamlConfiguration(Class<?> clazz, String resourcePath) throws IOException {
this(new YamlFile(clazz, resourcePath));
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-core
/**
* Read configuration from a file.
*
* @param file
* @throws Exception
*/
public YamlConfiguration(File file) throws IOException {
this(new YamlFile(file));
}
代码示例来源:origin: dstl/baleen
/**
* Read configuration from a file.
*
* @param file
* @throws Exception
*/
public YamlConfiguration(File file) throws IOException {
this(new YamlFile(file));
}
代码示例来源:origin: dstl/baleen
/**
* Construct configuration from raw yaml string.
*
* @param clazz
* @param resourcePath
* @throws Exception
*/
public YamlConfiguration(Class<?> clazz, String resourcePath) throws IOException {
this(new YamlFile(clazz, resourcePath));
}
代码示例来源:origin: dstl/baleen
/**
* Construct configuration from yaml file, allows yaml to use include statements
*
* @param file to read
*/
public YamlPipelineConfiguration(File file) throws IOException {
super(new IncludedYaml(new YamlFile(file)));
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-core
/**
* Construct configuration from yaml file, allows yaml to use include statements
*
* @param file to read
*/
public YamlPiplineConfiguration(File file) throws IOException {
super(new IncludedYaml(new YamlFile(file)));
}
代码示例来源:origin: uk.gov.dstl.baleen/baleen-core
/**
* Construct the IncludeYaml class wrapping the given yaml. Use, the default, file resolver to
* find included configuration.
*
* @param yaml to wrap
*/
public IncludedYaml(Yaml yaml) {
this(yaml, key -> new IncludedYaml(new YamlFile(new File(key))));
}
代码示例来源:origin: dstl/baleen
/**
* Construct the IncludeYaml class wrapping the given yaml. Use, the default, file resolver to
* find included configuration.
*
* @param yaml to wrap
*/
public IncludedYaml(Yaml yaml) {
this(yaml, key -> new IncludedYaml(new YamlFile(new File(key))));
}
代码示例来源:origin: dstl/baleen
@Override
public Yaml apply(String key) {
return new IncludedYaml(new YamlFile(YamlFileTest.class, key), this);
}
};
代码示例来源:origin: dstl/baleen
Optional<File> configurationFile = getConfigurationFile(argList.get(0));
if (configurationFile.isPresent()) {
yamls.add(new IncludedYaml(new YamlFile(configurationFile.get())));
代码示例来源:origin: dstl/baleen
@Before
public void setup() throws IOException {
yamlFile = new YamlFile(YamlFileTest.class, YAMLCONFIGURATION_YAML);
}
代码示例来源:origin: dstl/baleen
source = "string";
} else if (!Strings.isNullOrEmpty(file)) {
yaml = new IncludedYaml(new YamlFile(new File(file)));
source = "file";
} else {
代码示例来源:origin: uk.gov.dstl.baleen/baleen-core
source = "string";
} else if (!Strings.isNullOrEmpty(file)) {
yaml = new IncludedYaml(new YamlFile(new File(file)));
source = "file";
} else {
代码示例来源:origin: dstl/baleen
@Test
public void mapInclude() throws IOException {
Yaml yaml = new IncludedYaml(new YamlFile(YamlFileTest.class, PARENT_INCLUDE_YAML), mapping);
String expected = getRaw(PARENT_INCLUDE_YAML);
assertEquals(expected, yaml.original());
Object data = yaml.dataTree();
assertTrue(data instanceof Map);
Map<String, Object> dataTree = (Map<String, Object>) data;
assertTrue(dataTree.containsKey("collectionreader"));
List<Object> annotators = (List<Object>) dataTree.get("annotators");
assertEquals(2, annotators.size());
assertEquals(
"uk.gov.dstl.baleen.testing.DummyAnnotator",
((Map<String, Object>) annotators.get(1)).get("class"));
assertEquals(
"uk.gov.dstl.baleen.testing.DummyResourceAnnotator",
((Map<String, Object>) annotators.get(0)).get("class"));
}
代码示例来源:origin: dstl/baleen
@Test
public void simpleInclude() throws IOException {
Yaml yaml = new IncludedYaml(new YamlFile(YamlFileTest.class, PARENT_YAML), mapping);
String expected = getRaw(PARENT_YAML);
assertEquals(expected, yaml.original());
Object data = yaml.dataTree();
assertTrue(data instanceof Map);
Map<String, Object> dataTree = (Map<String, Object>) data;
assertTrue(dataTree.containsKey("collectionreader"));
List<Object> annotators = (List<Object>) dataTree.get("annotators");
assertEquals(2, annotators.size());
assertEquals(
"uk.gov.dstl.baleen.testing.DummyAnnotator",
((Map<String, Object>) annotators.get(1)).get("class"));
assertEquals(
"uk.gov.dstl.baleen.testing.DummyResourceAnnotator",
((Map<String, Object>) annotators.get(0)).get("class"));
}
代码示例来源:origin: dstl/baleen
@Test
public void nestedInclude() throws IOException {
Yaml yaml = new IncludedYaml(new YamlFile(YamlFileTest.class, GRAND_PARENT_YAML), mapping);
String expected = getRaw(GRAND_PARENT_YAML);
assertEquals(expected, yaml.original());
Object data = yaml.dataTree();
assertTrue(data instanceof Map);
Map<String, Object> dataTree = (Map<String, Object>) data;
assertTrue(dataTree.containsKey("collectionreader"));
List<Object> annotators = (List<Object>) dataTree.get("annotators");
assertEquals(4, annotators.size());
assertEquals(
"uk.gov.dstl.baleen.testing.DummyResourceAnnotator",
((Map<String, Object>) annotators.get(0)).get("class"));
assertEquals("uk.gov.dstl.baleen.testing.DummyAnnotator1", annotators.get(1));
assertEquals(
"uk.gov.dstl.baleen.testing.DummyAnnotator2",
((Map<String, Object>) annotators.get(2)).get("class"));
assertEquals(6, ((Map<String, Object>) annotators.get(2)).get("example.count"));
assertEquals("uk.gov.dstl.baleen.testing.DummyAnnotator4", annotators.get(3));
}
代码示例来源:origin: dstl/baleen
@Test
public void noIncludes() throws IOException {
Yaml yaml = new IncludedYaml(new YamlFile(YamlFileTest.class, YAMLCONFIGURATION_YAML), mapping);
String expected = getRaw(YAMLCONFIGURATION_YAML);
assertEquals(expected, yaml.original());
Object data = yaml.dataTree();
assertTrue(data instanceof Map);
Map<String, Object> dataTree = (Map<String, Object>) data;
assertNotNull(dataTree);
assertTrue(dataTree.containsKey("example"));
assertTrue(dataTree.containsKey("collectionreader"));
assertTrue(dataTree.containsKey("annotators"));
assertTrue(dataTree.containsKey("consumers"));
assertTrue(dataTree.get("example") instanceof Map);
}
代码示例来源:origin: dstl/baleen
@Test
public void testComplexMergeRequired() throws IOException {
Yaml toMerge = new YamlFile(getClass(), YAMLCONFIGURATION_YAML);
Map<String, Object> baseMap = (Map) toMerge.dataTree();
MergedYaml mergedYaml = new MergedYaml(ImmutableList.of(toMerge, toMerge));
String formatted = mergedYaml.formatted();
Object dataTree = mergedYaml.dataTree();
assertTrue(dataTree instanceof Map);
Map<String, Object> map = (Map) dataTree;
doubledValues(formatted, baseMap, map, "annotators");
doubledValues(formatted, baseMap, map, "consumers");
madeList(formatted, map, "example");
madeList(formatted, map, "collectionreader");
}
本文整理了Java中uk.gov.dstl.baleen.core.pipelines.YamlPipelineConfiguration类的一些代码示例,展示了YamlPipelineConfigu
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlMap类的一些代码示例,展示了YamlMap类的具体用法。这些代码示例主要来源于Github/Stac
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlFile类的一些代码示例,展示了YamlFile类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlString类的一些代码示例,展示了YamlString类的具体用法。这些代码示例主要来源于Githu
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlConfiguration类的一些代码示例,展示了YamlConfiguration类的具体用法。这些
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlMap.()方法的一些代码示例,展示了YamlMap.()的具体用法。这些代码示例主要来源于Githu
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlFile.()方法的一些代码示例,展示了YamlFile.()的具体用法。这些代码示例主要来源于Git
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlString.()方法的一些代码示例,展示了YamlString.()的具体用法。这些代码示例主要来源
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlConfiguration.()方法的一些代码示例,展示了YamlConfiguration.()的具
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlConfiguration.getAsList()方法的一些代码示例,展示了YamlConfigura
本文整理了Java中uk.gov.dstl.baleen.core.utils.yaml.YamlConfiguration.get()方法的一些代码示例,展示了YamlConfiguration.g
我是一名优秀的程序员,十分优秀!