當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。