Class XmlConfigurationLoader.Builder
- Enclosing class:
- XmlConfigurationLoader
XmlConfigurationLoader.
 This builder supports the following options:
- Since:
- 4.0.0
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final net.kyori.option.Option<String>The default tag name the created loader should use.static final net.kyori.option.Option<Boolean>Whether an XML declaration should be included as the first line of emitted documents from the created loader.static final net.kyori.option.Option<Integer>The size of indent (in spaces) the created loader should use.static final net.kyori.option.Option<Boolean>Whether externally included content should be resolved in documents read by the created loader.static final net.kyori.option.OptionSchemaA schema of options available to configure the XML loader.static final net.kyori.option.Option<Boolean>Whether explicit node types should be written out (to disambiguate between maps and lists).Fields inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.BuilderdefaultOptions, HEADER_MODE, headerMode, sink, source
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Builds the loader.@NonNull StringGets the default tag name to be used by the resultant loader.defaultTagName(String defaultTagName) Sets the default tag name the resultant loader should use.booleanGets if the resultant loader should include the XML declaration header when saving.includesXmlDeclaration(boolean includeXmlDeclaration) Sets if the resultant loader should include the XML declaration header when saving.intindent()Gets the level of indentation to be used by the resultant loader.@NonNull XmlConfigurationLoader.Builderindent(int indent) Sets the level of indentation the resultant loader should use.protected net.kyori.option.OptionSchemaGet the schema of available options that can be set on this loader.booleanGet whether external content should be resolved.resolvesExternalContent(boolean resolvesExternalContent) Sets whether external content should be resolved when loading data.@Nullable Schemaschema()Gets theSchemato be used by the resultant loader.Sets theSchemathe resultant loader should use.booleanGets if explicit type attributes should be written by the loader.writesExplicitType(boolean writeExplicitType) Sets if the resultant loader should write the explicit type of each node when saving nodes.Methods inherited from class org.spongepowered.configurate.loader.AbstractConfigurationLoader.BuilderbuildAndLoadString, buildAndSaveString, defaultOptions, defaultOptions, defaultOptions, editOptions, file, headerMode, headerMode, optionState, optionState, optionStateBuilder, path, sink, sink, source, source, url
- 
Field Details- 
SCHEMAA schema of options available to configure the XML loader.- Since:
- 4.2.0
 
- 
DEFAULT_TAG_NAMEThe default tag name the created loader should use.- Since:
- 4.2.0
- See Also:
 
- 
INDENTThe size of indent (in spaces) the created loader should use.- Since:
- 4.2.0
- See Also:
 
- 
WRITE_EXPLICIT_TYPEWhether explicit node types should be written out (to disambiguate between maps and lists).- Since:
- 4.2.0
- See Also:
 
- 
RESOLVE_EXTERNAL_CONTENTWhether externally included content should be resolved in documents read by the created loader.- Since:
- 4.2.0
- See Also:
 
- 
INCLUDE_XML_DECLARATIONWhether an XML declaration should be included as the first line of emitted documents from the created loader.- Since:
- 4.2.0
- See Also:
 
 
- 
- 
Constructor Details- 
Builderpublic Builder()
 
- 
- 
Method Details- 
optionSchemaDescription copied from class:AbstractConfigurationLoader.BuilderGet the schema of available options that can be set on this loader.This schema should inherit from AbstractConfigurationLoader.Builder.UNSAFE_SCHEMA.- Overrides:
- optionSchemain class- AbstractConfigurationLoader.Builder<XmlConfigurationLoader.Builder,- XmlConfigurationLoader> 
- Returns:
- the option schema
 
- 
indentSets the level of indentation the resultant loader should use.- Parameters:
- indent- the indent level
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
indentGets the level of indentation to be used by the resultant loader.- Returns:
- the indent level
- Since:
- 4.0.0
 
- 
schemaSets theSchemathe resultant loader should use.- Parameters:
- schema- the schema
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
schemaGets theSchemato be used by the resultant loader.- Returns:
- the schema
- Since:
- 4.0.0
 
- 
defaultTagNameSets the default tag name the resultant loader should use.- Parameters:
- defaultTagName- the default tag name
- Returns:
- this builder (for chaining)
- Since:
- 4.0.0
 
- 
defaultTagNameGets the default tag name to be used by the resultant loader.- Returns:
- the default tag name
- Since:
- 4.0.0
 
- 
writesExplicitTypeSets 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)
- Since:
- 4.0.0
 
- 
writesExplicitTypeGets if explicit type attributes should be written by the loader.See the method doc at writesExplicitType(boolean)for a more detailed explanation.- Returns:
- the default tag name
- Since:
- 4.0.0
 
- 
includesXmlDeclarationSets 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)
- Since:
- 4.0.0
 
- 
includesXmlDeclarationGets if the resultant loader should include the XML declaration header when saving.- Returns:
- if the XML declaration should be included
- Since:
- 4.0.0
 
- 
resolvesExternalContentSets whether external content should be resolved when loading data.Resolving this content could result in network requests being made, and will allow configuration files to access arbitrary URLs This setting should only be enabled with caution. Additionally, through use of features such as entity expansion and XInclude, documents can be crafted that will grow exponentially when parsed, requiring an amount of memory to store that may be greater than what is available for the JVM. By default, this is false. - Parameters:
- resolvesExternalContent- whether to resolve external entities
- Returns:
- this builder
- Since:
- 4.0.0
 
- 
resolvesExternalContentGet whether external content should be resolved.- Returns:
- value, defaulting to false
- Since:
- 4.0.0
 
- 
buildDescription copied from class:AbstractConfigurationLoader.BuilderBuilds the loader.- Specified by:
- buildin class- AbstractConfigurationLoader.Builder<XmlConfigurationLoader.Builder,- XmlConfigurationLoader> 
- Returns:
- a new loader
 
 
-