本文整理汇总了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();
}
}
}
示例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);
}
}
}
示例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);
}
示例4: getInstance
import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
public static ObjectMapperFactory getInstance() {
if (INSTANCE == null) {
INSTANCE = new NeutrinoObjectMapperFactory(false, Setting::comment);
}
return INSTANCE;
}
示例5: setCommentProcessor
import ninja.leaping.configurate.objectmapping.Setting; //导入依赖的package包/类
public Builder setCommentProcessor(@Nullable Function<Setting, String> commentProcessor) {
this.commentProcessor = commentProcessor;
return this;
}
示例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;
}
}
示例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();
}