Class JacksonConfigurationLoader
- java.lang.Object
-
- org.spongepowered.configurate.loader.AbstractConfigurationLoader<BasicConfigurationNode>
-
- org.spongepowered.configurate.jackson.JacksonConfigurationLoader
-
- All Implemented Interfaces:
ConfigurationNodeFactory<BasicConfigurationNode>
,ConfigurationLoader<BasicConfigurationNode>
public final class JacksonConfigurationLoader extends AbstractConfigurationLoader<BasicConfigurationNode>
A loader for JSON-formatted configurations, using the jackson library for parsing and generation.- Since:
- 4.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JacksonConfigurationLoader.Builder
Builds aJacksonConfigurationLoader
.
-
Field Summary
-
Fields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader
CONFIGURATE_LINE_PATTERN, CONFIGURATE_LINE_SEPARATOR, sink, source, SYSTEM_LINE_SEPARATOR
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JacksonConfigurationLoader.Builder
builder()
Creates a newJacksonConfigurationLoader
builder.BasicConfigurationNode
createNode(@NonNull ConfigurationOptions options)
Create an empty node with the provided options.protected void
loadInternal(BasicConfigurationNode node, BufferedReader reader)
Using a created node, attempt to read a configuration file.protected void
saveInternal(ConfigurationNode node, Writer writer)
Perform a save of the node to the provided writer.-
Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, checkCanWrite, 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 Detail
-
builder
public static JacksonConfigurationLoader.Builder builder()
Creates a newJacksonConfigurationLoader
builder.- Returns:
- a new builder
- Since:
- 4.0.0
-
loadInternal
protected void loadInternal(BasicConfigurationNode node, BufferedReader reader) throws ParsingException
Description copied from class:AbstractConfigurationLoader
Using a created node, attempt to read a configuration file.The header will already have been read if applicable.
- Specified by:
loadInternal
in classAbstractConfigurationLoader<BasicConfigurationNode>
- Parameters:
node
- node to load intoreader
- reader to load from- Throws:
ParsingException
- if an error occurs at any stage of loading
-
saveInternal
protected void saveInternal(ConfigurationNode node, Writer writer) throws ConfigurateException
Description copied from class:AbstractConfigurationLoader
Perform a save of the node to the provided writer.- Specified by:
saveInternal
in classAbstractConfigurationLoader<BasicConfigurationNode>
- Parameters:
node
- node to savewriter
- writer to output to- Throws:
ConfigurateException
- if any of the node's data is unsavable
-
createNode
public BasicConfigurationNode createNode(@NonNull ConfigurationOptions options)
Description copied from interface:ConfigurationNodeFactory
Create an empty node with the provided options.Node options may be overridden if the factory enforces specific requirements on options.
- Parameters:
options
- node options- Returns:
- newly created empty node
-
-