java.lang.Object
dev.orne.config.impl.AbstractConfigBuilderImpl<S>
dev.orne.config.impl.AbstractMutableConfigBuilderImpl<XmlMutableConfigBuilder>
dev.orne.config.impl.XmlMutableConfigBuilderImpl
- All Implemented Interfaces:
ConfigBuilder<XmlMutableConfigBuilder>,MutableConfigBuilder<XmlMutableConfigBuilder>,XmlConfigBaseBuilder<XmlMutableConfigBuilder>,XmlMutableConfigBuilder
@API(status=INTERNAL,
since="1.0")
public class XmlMutableConfigBuilderImpl
extends AbstractMutableConfigBuilderImpl<XmlMutableConfigBuilder>
implements XmlMutableConfigBuilder
Implementation of XML files based mutable configuration builder.
- Since:
- 1.0
- Version:
- 1.0, 2025-07
- Author:
- (w) Iker Hernaez
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull XmlConfigOptionsThe XML based configuration options.Fields inherited from class dev.orne.config.impl.AbstractMutableConfigBuilderImpl
mutableOptionsFields inherited from class dev.orne.config.impl.AbstractConfigBuilderImpl
optionsFields inherited from interface dev.orne.config.XmlConfigBaseBuilder
DEFAULT_ATTRIBUTE_PREFIX, DEFAULT_SEPARATOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXmlMutableConfigBuilderImpl(@NotNull ConfigOptions options, @NotNull MutableConfigOptions mutableOptions, @NotNull XmlConfigOptions xmlOptions) Copy constructor. -
Method Summary
Modifier and TypeMethodDescription@NotNull XmlMutableConfigBuilderAdds the specified custom properties to the configuration properties.@NotNull XmlMutableConfigBuilderAdds the specified custom properties to the configuration properties.@NotNull XmlMutableConfigImplbuild()Creates the configuration instance.@NotNull XmlMutableConfigBuilderLoads the configuration properties from the specified file.@NotNull XmlMutableConfigBuilderLoads the configuration properties from the specified ClassLoader resource.@NotNull XmlMutableConfigBuilderLoads the configuration properties from the specified URL.@NotNull XmlMutableConfigBuilderLoads the configuration properties from the file in the specified path.@NotNull XmlMutableConfigBuilderwithAttributePrefix(@NotEmpty String prefix) Sets the XML attributes references prefix.@NotNull XmlMutableConfigBuilderwithEmptyDocument(String namespaceURI, @NotNull String rootElementName) Creates an empty XML document with the specified root element name as configuration properties container.@NotNull XmlMutableConfigBuilderwithSeparator(@NotEmpty String separator) Sets the configuration nested properties separator.Methods inherited from class dev.orne.config.impl.AbstractMutableConfigBuilderImpl
withEncoderMethods inherited from class dev.orne.config.impl.AbstractConfigBuilderImpl
thisBuilder, withDecoder, withDecorator, withEncryption, withOverrideParentProperties, withParent, withVariableResolutionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.orne.config.ConfigBuilder
as, withDecoder, withDecorator, withEncryption, withOverrideParentProperties, withParent, withParent, withVariableResolutionMethods inherited from interface dev.orne.config.MutableConfigBuilder
withEncoderMethods inherited from interface dev.orne.config.XmlConfigBaseBuilder
withEmptyDocument
-
Field Details
-
xmlOptions
The XML based configuration options.
-
-
Constructor Details
-
XmlMutableConfigBuilderImpl
protected XmlMutableConfigBuilderImpl(@NotNull @NotNull ConfigOptions options, @NotNull @NotNull MutableConfigOptions mutableOptions, @NotNull @NotNull XmlConfigOptions xmlOptions) Copy constructor.- Parameters:
options- The configuration options to copy.mutableOptions- The mutable configuration options to copy.xmlOptions- The XML based configuration options to copy.
-
-
Method Details
-
withSeparator
@NotNull public @NotNull XmlMutableConfigBuilder withSeparator(@NotEmpty @NotEmpty String separator) Sets the configuration nested properties separator.- Specified by:
withSeparatorin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
separator- The configuration nested properties separator.- Returns:
- This instance, for method chaining.
-
withAttributePrefix
@NotNull public @NotNull XmlMutableConfigBuilder withAttributePrefix(@NotEmpty @NotEmpty String prefix) Sets the XML attributes references prefix.- Specified by:
withAttributePrefixin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
prefix- The XML attributes references prefix.- Returns:
- This instance, for method chaining.
-
withEmptyDocument
@NotNull public @NotNull XmlMutableConfigBuilder withEmptyDocument(String namespaceURI, @NotNull @NotNull String rootElementName) Creates an empty XML document with the specified root element name as configuration properties container.Note that any XML document loaded through
load()methods must match the same root element name.- Specified by:
withEmptyDocumentin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
namespaceURI- The XML document namespace URI.rootElementName- The root element name of the XML document to create.- Returns:
- This instance, for method chaining.
-
add
Adds the specified custom properties to the configuration properties.Note that property keys will be processed with the configured nested properties separator.
- Specified by:
addin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
values- The configuration properties.- Returns:
- This instance, for method chaining.
-
add
Adds the specified custom properties to the configuration properties.Note that an existing document is required to have been created with
withEmptyDocument()orload()methtods, so that the XML document has a root element to contain the properties, and that property keys will be processed with the configured nested properties separator and attribute prefix.- Specified by:
addin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
values- The configuration properties to add.- Returns:
- This instance, for method chaining.
-
load
Loads the configuration properties from the specified ClassLoader resource.- Specified by:
loadin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
path- The ClassLoader resource path.- Returns:
- This instance, for method chaining.
-
load
Loads the configuration properties from the file in the specified path.- Specified by:
loadin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
path- The file path.- Returns:
- This instance, for method chaining.
-
load
Loads the configuration properties from the specified file.- Specified by:
loadin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
file- The file to load.- Returns:
- This instance, for method chaining.
-
load
Loads the configuration properties from the specified URL.- Specified by:
loadin interfaceXmlConfigBaseBuilder<XmlMutableConfigBuilder>- Parameters:
url- The URL to load.- Returns:
- This instance, for method chaining.
-
build
Creates the configuration instance.- Specified by:
buildin interfaceConfigBuilder<XmlMutableConfigBuilder>- Specified by:
buildin interfaceMutableConfigBuilder<XmlMutableConfigBuilder>- Specified by:
buildin interfaceXmlMutableConfigBuilder- Returns:
- The configuration instance.
-