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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 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, 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 newXMLConfigurationLoaderbuilder.- Returns:
- A new builder
-
load
public @NonNull AttributedConfigurationNode load(@NonNull ConfigurationOptions options) throws IOException
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 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 IOException
Deprecated.- Specified by:
loadInternalin classAbstractConfigurationLoader<AttributedConfigurationNode>- Throws:
IOException
-
writeHeaderInternal
protected void writeHeaderInternal(Writer writer) throws IOException
- Overrides:
writeHeaderInternalin classAbstractConfigurationLoader<AttributedConfigurationNode>- Throws:
IOException
-
saveInternal
protected void saveInternal(ConfigurationNode node, Writer writer) throws IOException
- Specified by:
saveInternalin classAbstractConfigurationLoader<AttributedConfigurationNode>- Throws:
IOException
-
createEmptyNode
public @NonNull AttributedConfigurationNode createEmptyNode(@NonNull ConfigurationOptions options)
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
-
-