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


Java Setting类代码示例

本文整理汇总了Java中ninja.leaping.configurate.objectmapping.Setting的典型用法代码示例。如果您正苦于以下问题:Java Setting类的具体用法?Java Setting怎么用?Java Setting使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Setting类属于ninja.leaping.configurate.objectmapping包,在下文中一共展示了Setting类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDoNotMerge

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
private void getDoNotMerge(Stack<String> keySoFar, Class<?> configSerialisable, List<Object[]> doNotMergeList) {
    for (Field field : configSerialisable.getDeclaredFields()) {
        field.setAccessible(true);
        if (field.isAnnotationPresent(Setting.class)) {
            String value = field.getAnnotation(Setting.class).value();
            if (value.equals("")) {
                value = field.getName();
            }

            keySoFar.push(value);
            if (field.isAnnotationPresent(NoMergeIfPresent.class)) {
                doNotMergeList.add(keySoFar.toArray(new String[keySoFar.size()]));
            } else if (field.getType().isAnnotationPresent(ConfigSerializable.class)) {
                getDoNotMerge(keySoFar, field.getType(), doNotMergeList);
            }

            keySoFar.pop();
        }
    }
}
 
开发者ID:NucleusPowered,项目名称:QuickStartModuleLoader,代码行数:21,代码来源:AbstractAdaptableConfig.java

示例2: collectFields

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
protected void collectFields(Map<String, FieldData> cachedFields, Class<? super T> clazz) throws ObjectMappingException {
    if (this.fieldDataMapCache == null) {
        this.fieldDataMapCache = cachedFields;
        this.fieldsToProcess = Lists.newArrayList();
    }

    for (Field field : clazz.getDeclaredFields()) {
        if (field.isAnnotationPresent(Setting.class)) {
            fieldsToProcess.add(field);
        }
    }
}
 
开发者ID:NucleusPowered,项目名称:Neutrino,代码行数:13,代码来源:NeutrinoObjectMapper.java

示例3: build

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
public NeutrinoObjectMapperFactory build(boolean setAsDefault) {
    if (commentProcessor == null) {
        this.commentProcessor = Setting::comment;
    }

    return new NeutrinoObjectMapperFactory(setAsDefault, this.commentProcessor);
}
 
开发者ID:NucleusPowered,项目名称:Neutrino,代码行数:8,代码来源:NeutrinoObjectMapperFactory.java

示例4: getInstance

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
public static ObjectMapperFactory getInstance() {
    if (INSTANCE == null) {
        INSTANCE = new NeutrinoObjectMapperFactory(false, Setting::comment);
    }

    return INSTANCE;
}
 
开发者ID:NucleusPowered,项目名称:Neutrino,代码行数:8,代码来源:NeutrinoObjectMapperFactory.java

示例5: setCommentProcessor

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
public Builder setCommentProcessor(@Nullable Function<Setting, String> commentProcessor) {
    this.commentProcessor = commentProcessor;
    return this;
}
 
开发者ID:NucleusPowered,项目名称:Neutrino,代码行数:5,代码来源:NeutrinoObjectMapperFactory.java

示例6: NeutrinoObjectMapperFactory

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
private NeutrinoObjectMapperFactory(boolean setInstance, Function<Setting, String> commentProcessor) {
    this.commentProcessor = commentProcessor;
    if (INSTANCE == null || setInstance) {
        INSTANCE = this;
    }
}
 
开发者ID:NucleusPowered,项目名称:Neutrino,代码行数:7,代码来源:NeutrinoObjectMapperFactory.java

示例7: NeutrinoObjectMapper

import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
/**
 * Create a new object mapper of a given type
 *
 * @param clazz The type this object mapper will work with
 * @throws ObjectMappingException if the provided class is in someway invalid
 */
NeutrinoObjectMapper(Class<T> clazz, Function<Setting, String> commentProcessor) throws ObjectMappingException {
    super(clazz);
    this.commentProcessor = commentProcessor;
    collectFields();
}
 
开发者ID:NucleusPowered,项目名称:Neutrino,代码行数:12,代码来源:NeutrinoObjectMapper.java


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