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 classXMLConfigurationLoader.BuilderBuilds 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.Builderbuilder()Creates a newXMLConfigurationLoaderbuilder.@NonNull AttributedConfigurationNodecreateEmptyNode(@NonNull ConfigurationOptions options)Return an empty node of the most appropriate type for this loader@NonNull AttributedConfigurationNodeload(@NonNull ConfigurationOptions options)Attempts to load aConfigurationNodeusing this loader, from the defined source.voidloadInternal(AttributedConfigurationNode node, BufferedReader reader)Deprecated.protected voidsaveInternal(ConfigurationNode node, Writer writer)protected voidwriteHeaderInternal(Writer writer)Methods inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader
canLoad, canSave, getDefaultCommentHandler, getDefaultOptions, saveMethods 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
-
Method Details
-
builder
Creates a newXMLConfigurationLoaderbuilder.- Returns:
- A new builder
-
load
public @NonNull AttributedConfigurationNode load(@NonNull ConfigurationOptions options) throws IOExceptionDescription 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 interfaceConfigurationLoader<AttributedConfigurationNode>- Overrides:
loadin 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:
loadInternalin classAbstractConfigurationLoader<AttributedConfigurationNode>- Throws:
IOException
-
writeHeaderInternal
- Overrides:
writeHeaderInternalin classAbstractConfigurationLoader<AttributedConfigurationNode>- Throws:
IOException
-
saveInternal
- Specified by:
saveInternalin classAbstractConfigurationLoader<AttributedConfigurationNode>- 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
-