Package ninja.leaping.configurate.hocon
Class HoconConfigurationLoader
java.lang.Object
ninja.leaping.configurate.loader.AbstractConfigurationLoader<CommentedConfigurationNode>
ninja.leaping.configurate.hocon.HoconConfigurationLoader
- All Implemented Interfaces:
ConfigurationLoader<CommentedConfigurationNode>
public class HoconConfigurationLoader extends AbstractConfigurationLoader<CommentedConfigurationNode>
A loader for HOCON (Hodor)-formatted configurations, using the typesafe config library for
parsing and generation.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHoconConfigurationLoader.BuilderBuilds aHoconConfigurationLoader. -
Field Summary
Fields Modifier and Type Field Description static PatternCRLF_MATCHThe pattern used to match newlines.Fields inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
CONFIGURATE_LINE_SEPARATOR, LINE_SPLITTER, sink, source, SYSTEM_LINE_SEPARATOR -
Method Summary
Modifier and Type Method Description static @NonNull HoconConfigurationLoader.Builderbuilder()Creates a newHoconConfigurationLoaderbuilder.@NonNull CommentedConfigurationNodecreateEmptyNode(@NonNull ConfigurationOptions options)Return an empty node of the most appropriate type for this loaderstatic ConfigParseOptionsdefaultParseOptions()Gets the defaultConfigParseOptionsused by configurate.static ConfigRenderOptionsdefaultRenderOptions()Gets the defaultConfigRenderOptionsused by configurate.voidloadInternal(CommentedConfigurationNode node, BufferedReader reader)protected voidsaveInternal(ConfigurationNode node, Writer writer)Methods inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, getDefaultCommentHandler, getDefaultOptions, load, save, writeHeaderInternalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ninja.leaping.configurate.loader.ConfigurationLoader
createEmptyNode, load, loadToReference
-
Field Details
-
CRLF_MATCH
The pattern used to match newlines.
-
-
Method Details
-
defaultRenderOptions
Gets the defaultConfigRenderOptionsused by configurate.- Returns:
- The default render options
-
defaultParseOptions
Gets the defaultConfigParseOptionsused by configurate.- Returns:
- The default parse options
-
builder
Creates a newHoconConfigurationLoaderbuilder.- Returns:
- A new builder
-
loadInternal
public void loadInternal(CommentedConfigurationNode node, BufferedReader reader) throws IOException- Specified by:
loadInternalin classAbstractConfigurationLoader<CommentedConfigurationNode>- Throws:
IOException
-
saveInternal
- Specified by:
saveInternalin classAbstractConfigurationLoader<CommentedConfigurationNode>- Throws:
IOException
-
createEmptyNode
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
-