Class JSONSource
java.lang.Object
cc.carm.lib.configuration.source.section.ConfigureSource<SourcedSection,Map<String,Object>,JSONSource>
cc.carm.lib.configuration.source.file.FileConfigSource<SourcedSection,Map<String,Object>,JSONSource>
cc.carm.lib.configuration.source.json.JSONSource
- All Implemented Interfaces:
ConfigureSection
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull com.google.gson.Gsonprotected final @NotNull com.google.gson.Gsonprotected @Nullable SourcedSectionFields inherited from class cc.carm.lib.configuration.source.file.FileConfigSource
file, resourcePathFields inherited from class cc.carm.lib.configuration.source.section.ConfigureSource
holder, lastUpdateMillis -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJSONSource(@NotNull ConfigurationHolder<? extends JSONSource> holder, @NotNull File file, @Nullable String resourcePath) protectedJSONSource(@NotNull ConfigurationHolder<? extends JSONSource> holder, @NotNull File file, @Nullable String resourcePath, @NotNull com.google.gson.Gson gson) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidonReload()Reload the configuration.original()voidsave()Save the whole configuration.@NotNull SourcedSectionsection()protected @NotNull JSONSourceself()toString()Methods inherited from class cc.carm.lib.configuration.source.file.FileConfigSource
charset, copyDefaults, fileInputStream, fileOutputStream, fileReader, fileReadString, fileReadString, fileWriter, getResource, initializeFile, saveResourceMethods inherited from class cc.carm.lib.configuration.source.section.ConfigureSource
asMap, createSection, get, getKeys, getLastUpdateMillis, getValues, holder, isExpired, parent, path, pathSeparator, reload, remove, setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface cc.carm.lib.configuration.source.section.ConfigureSection
childPath, computeSection, computeSection, computeSection, computeSection, contains, containsValue, createSection, createSection, createSection, forEach, fullPath, get, get, get, get, getBoolean, getBoolean, getByte, getByte, getByteList, getChar, getChar, getCharList, getCollection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInt, getInt, getIntegerList, getList, getList, getLong, getLong, getLongList, getSection, getSectionList, getShort, getShort, getString, getString, getStringList, isBoolean, isByte, isChar, isDouble, isEmpty, isFloat, isInt, isList, isLong, isRoot, isSection, isShort, isString, isType, keys, size, stream, stream, stream, values
-
Field Details
-
DEFAULT_GSON
@NotNull public static final @NotNull com.google.gson.Gson DEFAULT_GSON -
gson
@NotNull protected final @NotNull com.google.gson.Gson gson -
rootSection
-
-
Constructor Details
-
JSONSource
protected JSONSource(@NotNull @NotNull ConfigurationHolder<? extends JSONSource> holder, @NotNull @NotNull File file, @Nullable @Nullable String resourcePath) -
JSONSource
protected JSONSource(@NotNull @NotNull ConfigurationHolder<? extends JSONSource> holder, @NotNull @NotNull File file, @Nullable @Nullable String resourcePath, @NotNull @NotNull com.google.gson.Gson gson)
-
-
Method Details
-
initialize
public void initialize() -
self
- Specified by:
selfin classConfigureSource<SourcedSection,Map<String, Object>, JSONSource>
-
original
- Specified by:
originalin classConfigureSource<SourcedSection,Map<String, Object>, JSONSource> - Returns:
- The original configuration object.
-
section
- Specified by:
sectionin classConfigureSource<SourcedSection,Map<String, Object>, JSONSource> - Returns:
- The root
ConfigureSection, which represents the entire configuration.
-
save
Description copied from class:ConfigureSourceSave the whole configuration.- Specified by:
savein classConfigureSource<SourcedSection,Map<String, Object>, JSONSource> - Throws:
Exception- If any error occurs while saving.
-
onReload
Description copied from class:ConfigureSourceReload the configuration.
This used for implementation, for external usage, useConfigureSource.reload()- Specified by:
onReloadin classConfigureSource<SourcedSection,Map<String, Object>, JSONSource> - Throws:
Exception- If any error occurs while reloading.
-
toString
-