Class XmlConfigurationLoader
java.lang.Object
org.spongepowered.configurate.loader.AbstractConfigurationLoader<AttributedConfigurationNode>
org.spongepowered.configurate.xml.XmlConfigurationLoader
- All Implemented Interfaces:
- ConfigurationNodeFactory<AttributedConfigurationNode>,- ConfigurationLoader<AttributedConfigurationNode>
public final class XmlConfigurationLoader
extends AbstractConfigurationLoader<AttributedConfigurationNode>
A loader for XML (Extensible Markup Language), using the native javax library
 for parsing and generation.
- Since:
- 4.0.0
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoaderCONFIGURATE_LINE_PATTERN, CONFIGURATE_LINE_SEPARATOR, sink, source, SYSTEM_LINE_SEPARATOR
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NonNull XmlConfigurationLoader.Builderbuilder()Creates a newXmlConfigurationLoaderbuilder.createNode(ConfigurationOptions options) Create an empty node with the provided options.@NonNull AttributedConfigurationNodeload(@NonNull ConfigurationOptions options) Attempts to load aConfigurationNodeusing this loader, from the defined source.protected voidloadInternal(AttributedConfigurationNode node, BufferedReader reader) Using a created node, attempt to read a configuration file.protected voidsaveInternal(ConfigurationNode node, Writer writer) Perform a save of the node to the provided writer.protected voidwriteHeaderInternal(Writer writer) Write out any implementation-specific file header.Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoadercanLoad, canSave, checkCanWrite, defaultCommentHandler, defaultOptions, loadToReference, saveMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.spongepowered.configurate.loader.ConfigurationLoaderloadMethods inherited from interface org.spongepowered.configurate.ConfigurationNodeFactorycreateNode, createNode, createNode, toListCollector, toListCollector, toMapCollector, toMapCollector
- 
Method Details- 
builderCreates a newXmlConfigurationLoaderbuilder.- Returns:
- a new builder
- Since:
- 4.0.0
 
- 
loadpublic @NonNull AttributedConfigurationNode load(@NonNull ConfigurationOptions options) throws ParsingException Description copied from interface:ConfigurationLoaderAttempts to load aConfigurationNodeusing this loader, from the defined source.The resultant node represents the root of the configuration being loaded. - Specified by:
- loadin interface- ConfigurationLoader<AttributedConfigurationNode>
- Overrides:
- loadin class- AbstractConfigurationLoader<AttributedConfigurationNode>
- Parameters:
- options- the options to load with
- Returns:
- the newly constructed node
- Throws:
- ParsingException
 
- 
loadInternalDescription copied from class:AbstractConfigurationLoaderUsing a created node, attempt to read a configuration file.The header will already have been read if applicable. - Specified by:
- loadInternalin class- AbstractConfigurationLoader<AttributedConfigurationNode>
- Parameters:
- node- node to load into
- reader- reader to load from
 
- 
writeHeaderInternalDescription copied from class:AbstractConfigurationLoaderWrite out any implementation-specific file header.- Overrides:
- writeHeaderInternalin class- AbstractConfigurationLoader<AttributedConfigurationNode>
- Parameters:
- writer- writer to output to
- Throws:
- IOException- if an error occurs in the implementation
 
- 
saveInternalDescription copied from class:AbstractConfigurationLoaderPerform a save of the node to the provided writer.- Specified by:
- saveInternalin class- AbstractConfigurationLoader<AttributedConfigurationNode>
- Parameters:
- node- node to save
- writer- writer to output to
- Throws:
- ConfigurateException- if any of the node's data is unsavable
 
- 
createNodeDescription copied from interface:ConfigurationNodeFactoryCreate an empty node with the provided options.Node options may be overridden if the factory enforces specific requirements on options. - Parameters:
- options- node options
- Returns:
- newly created empty node
 
 
-