當前位置: 首頁>>代碼示例>>Java>>正文


Java SettingsHolder類代碼示例

本文整理匯總了Java中ch.jalu.configme.SettingsHolder的典型用法代碼示例。如果您正苦於以下問題:Java SettingsHolder類的具體用法?Java SettingsHolder怎麽用?Java SettingsHolder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SettingsHolder類屬於ch.jalu.configme包,在下文中一共展示了SettingsHolder類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getSectionCommentMethods

import ch.jalu.configme.SettingsHolder; //導入依賴的package包/類
/**
 * Gets all {@link SectionComments} methods from {@link SettingsHolder} implementations.
 */
@SuppressWarnings("unchecked")
private List<Method> getSectionCommentMethods() {
    // Find all SettingsHolder classes
    List<Class<? extends SettingsHolder>> settingsClasses =
        new ClassCollector(TestHelper.SOURCES_FOLDER, TestHelper.PROJECT_ROOT + "settings/properties/")
            .collectClasses(SettingsHolder.class);
    checkArgument(!settingsClasses.isEmpty(), "Could not find any SettingsHolder classes");

    // Find all @SectionComments methods in these classes
    return settingsClasses.stream()
        .map(Class::getDeclaredMethods)
        .flatMap(Arrays::stream)
        .filter(method -> method.isAnnotationPresent(SectionComments.class))
        .collect(Collectors.toList());
}
 
開發者ID:AuthMe,項目名稱:AuthMeReloaded,代碼行數:19,代碼來源:SettingsConsistencyTest.java

示例2: collectData

import ch.jalu.configme.SettingsHolder; //導入依賴的package包/類
/**
 * Collects all properties and comment data from the provided classes.
 * Properties are sorted by their group, and each group is sorted by order of encounter.
 *
 * @param classes the classes to scan for their property data
 * @return collected configuration data
 */
public static ConfigurationData collectData(Iterable<Class<? extends SettingsHolder>> classes) {
    ConfigurationDataBuilder builder = new ConfigurationDataBuilder();
    for (Class<? extends SettingsHolder> clazz : classes) {
        builder.collectProperties(clazz);
        builder.commentsGatherer.collectAllSectionComments(clazz);
    }
    return new ConfigurationData(builder.propertyListBuilder.create(), builder.commentsGatherer.getComments());
}
 
開發者ID:AuthMe,項目名稱:ConfigMe,代碼行數:16,代碼來源:ConfigurationDataBuilder.java

示例3: scanForSettingsClasses

import ch.jalu.configme.SettingsHolder; //導入依賴的package包/類
@BeforeClass
public static void scanForSettingsClasses() {
    ClassCollector collector = new ClassCollector(TestHelper.SOURCES_FOLDER, SETTINGS_FOLDER);
    classes = collector.collectClasses(SettingsHolder.class);

    if (classes.isEmpty()) {
        throw new IllegalStateException("Did not find any SettingsHolder classes. Is the folder correct?");
    }
    System.out.println("Found " + classes.size() + " SettingsHolder implementations");
}
 
開發者ID:AuthMe,項目名稱:AuthMeReloaded,代碼行數:11,代碼來源:SettingsClassConsistencyTest.java


注:本文中的ch.jalu.configme.SettingsHolder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。