mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-21 01:38:51 +00:00
feat: 重命名NotSave为ReadOnly
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
5bb985e9eb
commit
7a12e0ce9b
@ -1,19 +1,19 @@
|
||||
package pw.yumc.YumCore.config.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 忽略配置保存
|
||||
*
|
||||
* @author 喵♂呜
|
||||
* @since 2016年10月24日 上午00:11
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface NotSave {
|
||||
}
|
||||
package pw.yumc.YumCore.config.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 只读配置
|
||||
*
|
||||
* @author 喵♂呜
|
||||
* @since 2016年10月24日 上午00:11
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ReadOnly {
|
||||
}
|
@ -14,8 +14,8 @@ import pw.yumc.YumCore.bukkit.Log;
|
||||
import pw.yumc.YumCore.commands.exception.CommandParseException;
|
||||
import pw.yumc.YumCore.config.annotation.ConfigNode;
|
||||
import pw.yumc.YumCore.config.annotation.Default;
|
||||
import pw.yumc.YumCore.config.annotation.NotSave;
|
||||
import pw.yumc.YumCore.config.annotation.Nullable;
|
||||
import pw.yumc.YumCore.config.annotation.ReadOnly;
|
||||
import pw.yumc.YumCore.config.exception.ConfigParseException;
|
||||
|
||||
/**
|
||||
@ -192,7 +192,7 @@ public abstract class AbstractInjectConfig {
|
||||
*/
|
||||
protected void setConfig(String path, Field field) {
|
||||
try {
|
||||
if (field.getAnnotation(NotSave.class) == null) {
|
||||
if (field.getAnnotation(ReadOnly.class) == null) {
|
||||
config.set(path, field.get(this));
|
||||
}
|
||||
} catch (IllegalArgumentException | IllegalAccessException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user