Package ninja.leaping.configurate.gson
Class GsonConfigurationLoader
- java.lang.Object
-
- ninja.leaping.configurate.loader.AbstractConfigurationLoader<ConfigurationNode>
-
- ninja.leaping.configurate.gson.GsonConfigurationLoader
-
- All Implemented Interfaces:
ConfigurationLoader<ConfigurationNode>
public class GsonConfigurationLoader extends AbstractConfigurationLoader<ConfigurationNode>
A loader for JSON-formatted configurations, using the GSON library for parsing and generation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGsonConfigurationLoader.BuilderBuilds aGsonConfigurationLoader.
-
Field Summary
-
Fields inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
CONFIGURATE_LINE_SEPARATOR, LINE_SPLITTER, sink, source, SYSTEM_LINE_SEPARATOR
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NonNull GsonConfigurationLoader.Builderbuilder()Creates a newGsonConfigurationLoaderbuilder.ConfigurationNodecreateEmptyNode(@NonNull ConfigurationOptions options)Return an empty node of the most appropriate type for this loaderprotected voidloadInternal(ConfigurationNode node, BufferedReader reader)voidsaveInternal(ConfigurationNode node, Writer writer)-
Methods inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, getDefaultCommentHandler, getDefaultOptions, load, save, writeHeaderInternal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ninja.leaping.configurate.loader.ConfigurationLoader
createEmptyNode, load, loadToReference
-
-
-
-
Method Detail
-
builder
public static @NonNull GsonConfigurationLoader.Builder builder()
Creates a newGsonConfigurationLoaderbuilder.- Returns:
- A new builder
-
loadInternal
protected void loadInternal(ConfigurationNode node, BufferedReader reader) throws IOException
- Specified by:
loadInternalin classAbstractConfigurationLoader<ConfigurationNode>- Throws:
IOException
-
saveInternal
public void saveInternal(ConfigurationNode node, Writer writer) throws IOException
- Specified by:
saveInternalin classAbstractConfigurationLoader<ConfigurationNode>- Throws:
IOException
-
createEmptyNode
public ConfigurationNode createEmptyNode(@NonNull ConfigurationOptions options)
Description copied from interface:ConfigurationLoaderReturn an empty node of the most appropriate type for this loader- Parameters:
options- The options to use with this node. Must not be null (seeConfigurationOptions.defaults())- Returns:
- The appropriate node type
-
-