本文整理汇总了Java中io.bootique.meta.config.ConfigListMetadata类的典型用法代码示例。如果您正苦于以下问题:Java ConfigListMetadata类的具体用法?Java ConfigListMetadata怎么用?Java ConfigListMetadata使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigListMetadata类属于io.bootique.meta.config包,在下文中一共展示了ConfigListMetadata类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testVisitListOfValues
import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
@Test
public void testVisitListOfValues() {
ConfigValueMetadata listMd1 = ConfigValueMetadata.builder().type(Integer.TYPE).build();
ConfigObjectMetadata m1Config = ConfigObjectMetadata
.builder("m1root")
.description("Root config of M1")
.type(ConfigRoot1.class)
.addProperty(ConfigListMetadata.builder("p1").elementType(listMd1).build())
.build();
assertLines(m1Config,
"m1root:",
" #",
" # Root config of M1",
" # Resolved as 'io.bootique.help.config.ConfigSectionGeneratorTest$ConfigRoot1'.",
" #",
"",
" p1:",
" #",
" # Resolved as 'List'.",
" #",
" - <int>"
);
}
示例2: visitListMetadata
import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
@Override
public Object visitListMetadata(ConfigListMetadata metadata) {
printNode(metadata, false);
ConfigSectionListGenerator childGenerator = new ConfigSectionListGenerator(out.withOffset(DEFAULT_OFFSET));
childGenerator.printListHeader(metadata);
metadata.getElementType().accept(childGenerator);
return null;
}
示例3: testVisitListOfObjects
import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
@Test
public void testVisitListOfObjects() {
ConfigObjectMetadata listMd2 = ConfigObjectMetadata.builder()
.type(ConfigRoot2.class)
.addProperty(ConfigValueMetadata.builder("p4").type(String.class).build())
.addProperty(ConfigValueMetadata.builder("p3").type(Boolean.TYPE).build())
.build();
ConfigObjectMetadata m1Config = ConfigObjectMetadata
.builder("m1root")
.description("Root config of M1")
.type(ConfigRoot1.class)
.addProperty(ConfigListMetadata.builder("p2").elementType(listMd2).description("I am a list").build())
.build();
assertLines(m1Config,
"m1root:",
" #",
" # Root config of M1",
" # Resolved as 'io.bootique.help.config.ConfigSectionGeneratorTest$ConfigRoot1'.",
" #",
"",
" p2:",
" #",
" # I am a list",
" # Resolved as 'List'.",
" #",
" -",
" #",
" # Resolved as 'io.bootique.help.config.ConfigSectionGeneratorTest$ConfigRoot2'.",
" #",
"",
" p3: <true|false>",
" p4: <string>"
);
}
示例4: printListHeader
import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
protected void printListHeader(ConfigListMetadata metadata) {
out.println("#");
printValueHeader(metadata);
out.println("#");
}
示例5: visitListMetadata
import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
@Override
public Optional<ConfigObjectMetadata> visitListMetadata(ConfigListMetadata metadata) {
return Optional.empty();
}
示例6: testVisitMapOfListsOfObjects
import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
@Test
public void testVisitMapOfListsOfObjects() {
ConfigObjectMetadata objectMd = ConfigObjectMetadata.builder()
.type(ConfigRoot2.class)
.addProperty(ConfigValueMetadata.builder("p4").type(String.class).build())
.addProperty(ConfigValueMetadata.builder("p3").type(Boolean.TYPE).build())
.build();
ConfigListMetadata subListMd = ConfigListMetadata
.builder()
.description("Sublist description")
.elementType(objectMd)
.build();
ConfigMapMetadata rootMapMd = ConfigMapMetadata
.builder("root")
.description("This is a map of lists.")
.keysType(String.class)
.valuesType(subListMd)
.build();
assertLines(rootMapMd,
"root:",
" #",
" # This is a map of lists.",
" # Resolved as 'Map'.",
" #",
" <string>:",
" #",
" # Sublist description",
" # Resolved as 'List'.",
" #",
" -",
" #",
" # Resolved as 'io.bootique.help.config.ConfigSectionGeneratorTest$ConfigRoot2'.",
" #",
"",
" p3: <true|false>",
" p4: <string>"
);
}