public class HoconConfigFile extends ConfigFile<ninja.leaping.configurate.commented.CommentedConfigurationNode>
ConfigFile for the HOCON specification.| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOGGER
The HoconConfigFile logger.
|
| Constructor and Description |
|---|
HoconConfigFile(java.nio.file.Path file,
ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.commented.CommentedConfigurationNode> loader,
ninja.leaping.configurate.commented.CommentedConfigurationNode root)
Constructs a new
HoconConfigFile. |
| Modifier and Type | Method and Description |
|---|---|
ninja.leaping.configurate.commented.CommentedConfigurationNode |
getNode(java.lang.Object... path)
Gets a
ConfigurationNode on any level. |
ninja.leaping.configurate.commented.CommentedConfigurationNode |
getNode(java.lang.Object path)
Gets a
ConfigurationNode on the first level. |
static HoconConfigFile |
load(java.nio.file.Path file)
Creates a
HoconConfigFile. |
static HoconConfigFile |
load(java.nio.file.Path file,
java.lang.String resource)
Creates a
HoconConfigFile. |
static HoconConfigFile |
load(java.nio.file.Path file,
java.lang.String resource,
boolean overwrite)
Creates a
HoconConfigFile. |
static HoconConfigFile |
load(java.nio.file.Path file,
java.lang.String resource,
boolean overwrite,
boolean merge)
Deprecated.
|
getFile, getFileDirectory, getLoader, getNode, reload, reloadWithException, save, saveWithExceptionpublic HoconConfigFile(@Nonnull
java.nio.file.Path file,
@Nonnull
ninja.leaping.configurate.loader.ConfigurationLoader<ninja.leaping.configurate.commented.CommentedConfigurationNode> loader,
@Nonnull
ninja.leaping.configurate.commented.CommentedConfigurationNode root)
HoconConfigFile.
Additionally, passes a CommentedConfigurationNode
for the loader and the root node.
file - the location of the configuration file on diskloader - the active loaded for the configuration file on diskroot - the loaded CommentedConfigurationNode at the root levelpublic ninja.leaping.configurate.commented.CommentedConfigurationNode getNode(java.lang.Object path)
ConfigurationNode on the first level.
Overrides ConfigFile.getNode(Object) to return commented nodes.
getNode in class ConfigFile<ninja.leaping.configurate.commented.CommentedConfigurationNode>path - the key for the nodeConfigurationNode on the first levelpublic ninja.leaping.configurate.commented.CommentedConfigurationNode getNode(java.lang.Object... path)
ConfigurationNode on any level.
Overrides ConfigFile.getNode(Object...) to return commented nodes.
getNode in class ConfigFile<ninja.leaping.configurate.commented.CommentedConfigurationNode>path - the key path for the nodeConfigurationNode on any levelpublic static HoconConfigFile load(java.nio.file.Path file) throws java.io.IOException
HoconConfigFile.file - the location of the config file on diskHoconConfigFilejava.io.IOException - if files cannot be properly deleted/createdpublic static HoconConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource) throws java.io.IOException
HoconConfigFile.
Also merges a configuration file from classpath into the file on disk.
file - the location of the config file on diskresource - the location of the resource in the classpathHoconConfigFilejava.io.IOException - if files cannot be properly deleted/createdpublic static HoconConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource, boolean overwrite) throws java.io.IOException
HoconConfigFile.
Also merges a configuration file from the classpath into the file on disk.
May delete file on disk before copying resource.
file - the location of the config file on diskresource - the location of the resource in the classpathoverwrite - whether or not to delete the file on disk before copying resourceHoconConfigFilejava.io.IOException - if files cannot be properly deleted/created@Deprecated public static HoconConfigFile load(@Nonnull java.nio.file.Path file, @Nullable java.lang.String resource, boolean overwrite, boolean merge) throws java.io.IOException
HoconConfigFile.
May merge a configuration file from the classpath into the file on disk.
May delete the file on disk before copying resource.
If accessing this method directly, keep in mind that passing true
for overwrite but false for merge is going
to result in a non-existent file on disk.
file - the location of the config file on diskresource - the location of the resource in the classpathoverwrite - whether or not to delete the file on disk before copying the resourcemerge - whether or not to merge the resource into the file on diskHoconConfigFilejava.io.IOException - if files cannot be properly deleted/created