mirror of
https://github.com/CarmJos/EasyConfiguration.git
synced 2026-06-04 18:48:20 +08:00
feat(sql): Support SQL sources
This commit is contained in:
@@ -4,6 +4,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -29,7 +31,6 @@ public abstract class ValueType<T> {
|
||||
public static final ValueType<Character> CHAR = ofPrimitiveType(Character.class);
|
||||
public static final ValueType<Character> CHAR_TYPE = ofPrimitiveType(char.class);
|
||||
|
||||
|
||||
public static final ValueType<?>[] PRIMITIVE_TYPES = {
|
||||
STRING, INTEGER, LONG, DOUBLE, FLOAT, BOOLEAN, BYTE, SHORT, CHAR,
|
||||
INTEGER_TYPE, LONG_TYPE, DOUBLE_TYPE, FLOAT_TYPE, BOOLEAN_TYPE, BYTE_TYPE, SHORT_TYPE, CHAR_TYPE
|
||||
|
||||
@@ -23,12 +23,13 @@ public interface StandardOptions {
|
||||
ConfigurationOption<Boolean> LOAD_SUB_CLASSES = of(true);
|
||||
|
||||
/**
|
||||
* Whether to pre parse the config values.
|
||||
* <br> if false, the values will be parsed when calling
|
||||
* {@link cc.carm.lib.configuration.value.ConfigValue#get()}
|
||||
* Whether to pre parse the config values,
|
||||
* may good to set true if you want to keep the config format.
|
||||
* <br> if true, the values will be parsed when
|
||||
* {@link ConfigurationHolder#initialize(Configuration)}.
|
||||
* <br> if false, the values will be parsed when calling
|
||||
* {@link cc.carm.lib.configuration.value.ConfigValue#get()}
|
||||
*/
|
||||
ConfigurationOption<Boolean> PRELOAD = of(false);
|
||||
ConfigurationOption<Boolean> PRELOAD = of(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cc.carm.lib.configuration.adapter.ValueType;
|
||||
import cc.carm.lib.configuration.source.ConfigurationHolder;
|
||||
import cc.carm.lib.configuration.source.meta.ConfigurationMetaHolder;
|
||||
import cc.carm.lib.configuration.source.section.ConfigureSource;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -108,15 +109,16 @@ public class ValueManifest<T> {
|
||||
return holder().metadata(path());
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
protected Object getData() {
|
||||
return config().get(path());
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
protected void setData(@Nullable Object value) {
|
||||
config().set(path(), value);
|
||||
}
|
||||
|
||||
|
||||
private static final @NotNull BiConsumer<@NotNull ConfigurationHolder<?>, @NotNull String> EMPTY_INITIALIZER = (provider, valuePath) -> {
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user