本文整理匯總了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>"
);
}