当前位置: 首页>>代码示例>>Java>>正文


Java ConfigListMetadata类代码示例

本文整理汇总了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>"
    );
}
 
开发者ID:bootique,项目名称:bootique,代码行数:27,代码来源:ConfigSectionGeneratorTest.java

示例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;
}
 
开发者ID:bootique,项目名称:bootique,代码行数:11,代码来源:ConfigSectionGenerator.java

示例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>"
    );
}
 
开发者ID:bootique,项目名称:bootique,代码行数:38,代码来源:ConfigSectionGeneratorTest.java

示例4: printListHeader

import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
protected void printListHeader(ConfigListMetadata metadata) {

        out.println("#");
        printValueHeader(metadata);
        out.println("#");
    }
 
开发者ID:bootique,项目名称:bootique,代码行数:7,代码来源:ConfigSectionGenerator.java

示例5: visitListMetadata

import io.bootique.meta.config.ConfigListMetadata; //导入依赖的package包/类
@Override
public Optional<ConfigObjectMetadata> visitListMetadata(ConfigListMetadata metadata) {
    return Optional.empty();
}
 
开发者ID:bootique,项目名称:bootique,代码行数:5,代码来源:ModuleMetadata.java

示例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>"
    );
}
 
开发者ID:bootique,项目名称:bootique,代码行数:43,代码来源:ConfigSectionGeneratorTest.java


注:本文中的io.bootique.meta.config.ConfigListMetadata类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。