Class GsonConfigurationLoader
java.lang.Object
org.spongepowered.configurate.loader.AbstractConfigurationLoader<BasicConfigurationNode>
org.spongepowered.configurate.gson.GsonConfigurationLoader
- All Implemented Interfaces:
ConfigurationNodeFactory<BasicConfigurationNode>
,ConfigurationLoader<BasicConfigurationNode>
public final class GsonConfigurationLoader
extends AbstractConfigurationLoader<BasicConfigurationNode>
A loader for JSON-formatted configurations, using the GSON library for
parsing and generation.
- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader
CONFIGURATE_LINE_PATTERN, CONFIGURATE_LINE_SEPARATOR, sink, source, SYSTEM_LINE_SEPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull GsonConfigurationLoader.Builder
builder()
Creates a newGsonConfigurationLoader
builder.protected void
createNode
(ConfigurationOptions options) static TypeSerializerCollection
Get aTypeSerializerCollection
for handling Gson types.protected void
loadInternal
(BasicConfigurationNode node, BufferedReader reader) protected void
saveInternal
(ConfigurationNode node, Writer writer) Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, defaultCommentHandler, defaultOptions, load, loadToReference, save, writeHeaderInternal
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.spongepowered.configurate.loader.ConfigurationLoader
load
Methods inherited from interface org.spongepowered.configurate.ConfigurationNodeFactory
createNode, createNode, createNode, toListCollector, toListCollector, toMapCollector, toMapCollector
-
Method Details
-
builder
Creates a newGsonConfigurationLoader
builder.- Returns:
- a new builder
- Since:
- 4.0.0
-
gsonSerializers
Get aTypeSerializerCollection
for handling Gson types.Currently, this serializer can handle:
JsonElement
and its subtypes:JsonArray
,JsonObject
,JsonPrimitive
, andJsonNull
- Returns:
- gson type serializers
- Since:
- 4.1.0
-
checkCanWrite
- Overrides:
checkCanWrite
in classAbstractConfigurationLoader<BasicConfigurationNode>
- Throws:
ConfigurateException
-
loadInternal
protected void loadInternal(BasicConfigurationNode node, BufferedReader reader) throws ParsingException - Specified by:
loadInternal
in classAbstractConfigurationLoader<BasicConfigurationNode>
- Throws:
ParsingException
-
saveInternal
- Specified by:
saveInternal
in classAbstractConfigurationLoader<BasicConfigurationNode>
- Throws:
ConfigurateException
-
createNode
-