当前位置: 首页>>代码示例>>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;未经允许,请勿转载。