feat: 重命名NotSave为ReadOnly

Signed-off-by: 502647092 <admin@yumc.pw>
merge/1/MERGE
502647092 2016-10-26 17:04:15 +08:00
parent 5bb985e9eb
commit 7a12e0ce9b
2 changed files with 21 additions and 21 deletions

View File

@ -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 20161024 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 20161024 00:11
*/
@Target(ElementType.FIELD)
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface ReadOnly {
}

View File

@ -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) {