mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 05:50:08 +00:00
rudimentary metaconfig API
This commit is contained in:
1 parent
1b05ca8e96
commit
91703c4fc9
8 files changed
+75
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
package com.dfsek.terra.api.config.meta;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Context from which to pull {@link MetaValue}s
|
||||||
|
*/
|
||||||
|
public interface MetaContext {
|
||||||
|
<T> T load();
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.dfsek.terra.api.config.meta;
|
||||||
|
|
||||||
|
public interface MetaValue<T> {
|
||||||
|
T load(MetaContext context);
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.dfsek.terra.api.config.meta.specific;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.config.meta.MetaValue;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface MetaList<T> extends MetaValue<List<T>> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.dfsek.terra.api.config.meta.specific;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.config.meta.MetaValue;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface MetaMap<K, V> extends MetaValue<Map<K, V>> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.dfsek.terra.api.config.meta.specific;
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.config.meta.MetaValue;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public interface MetaSet<T> extends MetaValue<Set<T>> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.dfsek.terra.config.loaders.meta;
|
||||||
|
|
||||||
|
import com.dfsek.tectonic.exception.LoadException;
|
||||||
|
import com.dfsek.tectonic.loading.ConfigLoader;
|
||||||
|
import com.dfsek.tectonic.loading.TypeLoader;
|
||||||
|
import com.dfsek.terra.api.config.meta.specific.MetaList;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
public class MetaListLoader implements TypeLoader<MetaList<?>> {
|
||||||
|
@Override
|
||||||
|
public MetaList<?> load(Type t, Object c, ConfigLoader loader) throws LoadException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.dfsek.terra.config.loaders.meta;
|
||||||
|
|
||||||
|
import com.dfsek.tectonic.exception.LoadException;
|
||||||
|
import com.dfsek.tectonic.loading.ConfigLoader;
|
||||||
|
import com.dfsek.tectonic.loading.TypeLoader;
|
||||||
|
import com.dfsek.terra.api.config.meta.specific.MetaMap;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
|
public class MetaMapLoader implements TypeLoader<MetaMap<?, ?>> {
|
||||||
|
@Override
|
||||||
|
public MetaMap<?, ?> load(Type t, Object c, ConfigLoader loader) throws LoadException {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.dfsek.terra.config.loaders.meta;
|
||||||
|
|
||||||
|
import com.dfsek.tectonic.loading.TypeLoader;
|
||||||
|
import com.dfsek.terra.api.config.meta.MetaValue;
|
||||||
|
|
||||||
|
public abstract class MetaValueLoader<M extends MetaValue<T>, T> implements TypeLoader<T> {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in new issue
Block a user