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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 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 Detail
-
builder
public static @NonNull XMLConfigurationLoader.Builder builder()
Creates a newXMLConfigurationLoader
builder.- Returns:
- A new builder
-
load
public @NonNull AttributedConfigurationNode load(@NonNull ConfigurationOptions options) throws IOException
Description 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 IOException
Deprecated.- Specified by:
loadInternal
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Throws:
IOException
-
writeHeaderInternal
protected void writeHeaderInternal(Writer writer) throws IOException
- Overrides:
writeHeaderInternal
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Throws:
IOException
-
saveInternal
protected void saveInternal(ConfigurationNode node, Writer writer) throws IOException
- Specified by:
saveInternal
in classAbstractConfigurationLoader<AttributedConfigurationNode>
- Throws:
IOException
-
createEmptyNode
public @NonNull AttributedConfigurationNode 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
-
-