Package ninja.leaping.configurate.xml
Class XMLConfigurationLoader
java.lang.Object
ninja.leaping.configurate.loader.AbstractConfigurationLoader<AttributedConfigurationNode>
ninja.leaping.configurate.xml.XMLConfigurationLoader
- All Implemented Interfaces:
ConfigurationLoader<AttributedConfigurationNode>
public class XMLConfigurationLoader extends AbstractConfigurationLoader<AttributedConfigurationNode>
A loader for XML (Extensible Markup Language), using the native javax library for parsing and
generation.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XMLConfigurationLoader.Builder
Builds aXMLConfigurationLoader
. -
Field Summary
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 XMLConfigurationLoader.Builder
builder()
Creates a newXMLConfigurationLoader
builder.@NonNull AttributedConfigurationNode
createEmptyNode(@NonNull ConfigurationOptions options)
Return an empty node of the most appropriate type for this loader@NonNull AttributedConfigurationNode
load(@NonNull ConfigurationOptions options)
Attempts to load aConfigurationNode
using this loader, from the defined source.void
loadInternal(AttributedConfigurationNode node, BufferedReader reader)
Deprecated.protected void
saveInternal(ConfigurationNode node, Writer writer)
protected void
writeHeaderInternal(Writer writer)
Methods inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, getDefaultCommentHandler, getDefaultOptions, save
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
-
Method Details
-
builder
Creates a newXMLConfigurationLoader
builder.- Returns:
- A new builder
-
load
public @NonNull AttributedConfigurationNode load(@NonNull ConfigurationOptions options) throws IOExceptionDescription copied from interface:ConfigurationLoader
Attempts to load aConfigurationNode
using this loader, from the defined source.The resultant node represents the root of the configuration being loaded.
- Specified by:
load
in interfaceConfigurationLoader<AttributedConfigurationNode>
- Overrides:
load
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Parameters:
options
- The options to load with- Returns:
- The newly constructed node
- Throws:
IOException
- if any sort of error occurs with reading or parsing the configuration
-
loadInternal
@Deprecated public void loadInternal(AttributedConfigurationNode node, BufferedReader reader) throws IOExceptionDeprecated.- Specified by:
loadInternal
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Throws:
IOException
-
writeHeaderInternal
- Overrides:
writeHeaderInternal
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Throws:
IOException
-
saveInternal
- Specified by:
saveInternal
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Throws:
IOException
-
createEmptyNode
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
-