Package ninja.leaping.configurate.xml
Class XMLConfigurationLoader.Builder
java.lang.Object
ninja.leaping.configurate.loader.AbstractConfigurationLoader.Builder<XMLConfigurationLoader.Builder>
ninja.leaping.configurate.xml.XMLConfigurationLoader.Builder
- Enclosing class:
- XMLConfigurationLoader
public static class XMLConfigurationLoader.Builder extends AbstractConfigurationLoader.Builder<XMLConfigurationLoader.Builder>
Builds a
XMLConfigurationLoader.-
Field Summary
Fields inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader.Builder
defaultOptions, headerMode, sink, source -
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder() -
Method Summary
Modifier and Type Method Description @NonNull XMLConfigurationLoaderbuild()Builds the loader.@NonNull StringgetDefaultTagName()Gets the default tag name to be used by the resultant loader.intgetIndent()Gets the level of indentation to be used by the resultant loader.@Nullable SchemagetSchema()Gets theSchemato be used by the resultant loader.@NonNull XMLConfigurationLoader.BuildersetDefaultTagName(@NonNull String defaultTagName)Sets the default tag name the resultant loader should use.@NonNull XMLConfigurationLoader.BuildersetIncludeXmlDeclaration(boolean includeXmlDeclaration)Sets if the resultant loader should include the XML declaration header when saving.@NonNull XMLConfigurationLoader.BuildersetIndent(int indent)Sets the level of indentation the resultant loader should use.@NonNull XMLConfigurationLoader.BuildersetSchema(@Nullable Schema schema)Sets theSchemathe resultant loader should use.@NonNull XMLConfigurationLoader.BuildersetWriteExplicitType(boolean writeExplicitType)Sets if the resultant loader should write the explicit type of each node when saving nodes.booleanshouldIncludeXmlDeclaration()Gets if the resultant loader should include the XML declaration header when saving.booleanshouldWriteExplicitType()Gets if explicit type attributes should be written by the resultant loader.Methods inherited from class ninja.leaping.configurate.loader.AbstractConfigurationLoader.Builder
getDefaultOptions, getHeaderMode, getSink, getSource, preservesHeader, setDefaultOptions, setDefaultOptions, setFile, setHeaderMode, setPath, setPreservesHeader, setSink, setSource, setURL
-
Constructor Details
-
Method Details
-
setIndent
Sets the level of indentation the resultant loader should use.- Parameters:
indent- The indent level- Returns:
- This builder (for chaining)
-
getIndent
Gets the level of indentation to be used by the resultant loader.- Returns:
- The indent level
-
setSchema
Sets theSchemathe resultant loader should use.- Parameters:
schema- The schema- Returns:
- This builder (for chaining)
-
getSchema
Gets theSchemato be used by the resultant loader.- Returns:
- The schema
-
setDefaultTagName
Sets the default tag name the resultant loader should use.- Parameters:
defaultTagName- The default tag name- Returns:
- This builder (for chaining)
-
getDefaultTagName
Gets the default tag name to be used by the resultant loader.- Returns:
- The default tag name
-
setWriteExplicitType
Sets if the resultant loader should write the explicit type of each node when saving nodes.This is necessary in some cases, as XML has no explicit definition of an array or list. The loader is able to infer the type in some cases, but this is inaccurate in some cases, for example lists with only one element.
- Parameters:
writeExplicitType- If the loader should write explicit types- Returns:
- This builder (for chaining)
-
shouldWriteExplicitType
Gets if explicit type attributes should be written by the resultant loader.See the method doc for
setWriteExplicitType(boolean)for a more detailed explanation.- Returns:
- The default tag name
-
setIncludeXmlDeclaration
public @NonNull XMLConfigurationLoader.Builder setIncludeXmlDeclaration(boolean includeXmlDeclaration)Sets if the resultant loader should include the XML declaration header when saving.- Parameters:
includeXmlDeclaration- If the XML declaration should be included- Returns:
- This builder (for chaining)
-
shouldIncludeXmlDeclaration
Gets if the resultant loader should include the XML declaration header when saving.- Returns:
- If the XML declaration should be included
-
build
Description copied from class:AbstractConfigurationLoader.BuilderBuilds the loader.- Specified by:
buildin classAbstractConfigurationLoader.Builder<XMLConfigurationLoader.Builder>- Returns:
- The loader
-