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 class
HoconConfigurationLoader.Builder
Builds aHoconConfigurationLoader
.
-
Field Summary
Fields Modifier and Type Field Description static Pattern
CRLF_MATCH
The 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NonNull HoconConfigurationLoader.Builder
builder()
Creates a newHoconConfigurationLoader
builder.@NonNull CommentedConfigurationNode
createEmptyNode(@NonNull ConfigurationOptions options)
Return an empty node of the most appropriate type for this loaderstatic ConfigParseOptions
defaultParseOptions()
Gets the defaultConfigParseOptions
used by configurate.static ConfigRenderOptions
defaultRenderOptions()
Gets the defaultConfigRenderOptions
used by configurate.void
loadInternal(CommentedConfigurationNode node, BufferedReader reader)
protected void
saveInternal(ConfigurationNode node, Writer writer)
-
Methods inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, getDefaultCommentHandler, getDefaultOptions, load, save, writeHeaderInternal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ninja.leaping.configurate.loader.ConfigurationLoader
createEmptyNode, load, loadToReference
-
-
-
-
Field Detail
-
CRLF_MATCH
public static final Pattern CRLF_MATCH
The pattern used to match newlines.
-
-
Method Detail
-
defaultRenderOptions
public static ConfigRenderOptions defaultRenderOptions()
Gets the defaultConfigRenderOptions
used by configurate.- Returns:
- The default render options
-
defaultParseOptions
public static ConfigParseOptions defaultParseOptions()
Gets the defaultConfigParseOptions
used by configurate.- Returns:
- The default parse options
-
builder
public static @NonNull HoconConfigurationLoader.Builder builder()
Creates a newHoconConfigurationLoader
builder.- Returns:
- A new builder
-
loadInternal
public void loadInternal(CommentedConfigurationNode node, BufferedReader reader) throws IOException
- Specified by:
loadInternal
in classAbstractConfigurationLoader<CommentedConfigurationNode>
- Throws:
IOException
-
saveInternal
protected void saveInternal(ConfigurationNode node, Writer writer) throws IOException
- Specified by:
saveInternal
in classAbstractConfigurationLoader<CommentedConfigurationNode>
- Throws:
IOException
-
createEmptyNode
public @NonNull CommentedConfigurationNode createEmptyNode(@NonNull ConfigurationOptions options)
Description copied from interface:ConfigurationLoader
Return 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
-
-