Interface ConfigurationLoader<N extends ConfigurationNode>
- Type Parameters:
N
- theConfigurationNode
type produced by the loader
- All Superinterfaces:
ConfigurationNodeFactory<N>
- All Known Implementing Classes:
AbstractConfigurationLoader
,GsonConfigurationLoader
,HoconConfigurationLoader
,JacksonConfigurationLoader
,XmlConfigurationLoader
,YamlConfigurationLoader
public interface ConfigurationLoader<N extends ConfigurationNode>
extends ConfigurationNodeFactory<N>
Represents an object which can load and save
ConfigurationNode
objects in a specific
configuration format.
An abstract implementation is provided by AbstractConfigurationLoader
.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canLoad()
Gets if this loader is capable of loading configurations.default boolean
canSave()
Gets if this loader is capable of saving configurations.default N
load()
Attempts to load aConfigurationNode
using this loader, from the defined source.load
(ConfigurationOptions options) Attempts to load aConfigurationNode
using this loader, from the defined source.Attempts to load data from the defined source into aConfigurationReference
.void
save
(ConfigurationNode node) Attempts to save aConfigurationNode
using this loader, to the defined sink.Methods inherited from interface org.spongepowered.configurate.ConfigurationNodeFactory
createNode, createNode, createNode, createNode, defaultOptions, toListCollector, toListCollector, toMapCollector, toMapCollector
-
Method Details
-
load
Attempts to load aConfigurationNode
using this loader, from the defined source.The resultant node represents the root of the configuration being loaded.
The
default options
will be used to construct the resultant configuration nodes.- Returns:
- the newly constructed node
- Throws:
ConfigurateException
- if any sort of error occurs with reading or parsing the configuration- Since:
- 4.0.0
-
load
Attempts to load aConfigurationNode
using this loader, from the defined source.The resultant node represents the root of the configuration being loaded.
- Parameters:
options
- the options to load with- Returns:
- the newly constructed node
- Throws:
ConfigurateException
- if any sort of error occurs with reading or parsing the configuration- Since:
- 4.0.0
-
loadToReference
Attempts to load data from the defined source into aConfigurationReference
. The returned reference will not reload automatically.- Returns:
- the created reference
- Throws:
ConfigurateException
- when an error occurs within the loader- Since:
- 4.0.0
- See Also:
-
save
Attempts to save aConfigurationNode
using this loader, to the defined sink.- Parameters:
node
- the node to save- Throws:
ConfigurateException
- if any sort of error occurs with writing or generating the configuration- Since:
- 4.0.0
-
canLoad
Gets if this loader is capable of loading configurations.- Returns:
- if this loader can load
- Since:
- 4.0.0
-
canSave
Gets if this loader is capable of saving configurations.- Returns:
- if this loader can save
- Since:
- 4.0.0
-