Interface XmlConfigBaseBuilder<S extends XmlConfigBaseBuilder<S>>

Type Parameters:
S - The concrete type of the builder.
All Superinterfaces:
ConfigBuilder<S>
All Known Subinterfaces:
XmlConfigBuilder, XmlMutableConfigBuilder
All Known Implementing Classes:
XmlConfigBuilderImpl, XmlMutableConfigBuilderImpl

@API(status=STABLE, since="1.0") public interface XmlConfigBaseBuilder<S extends XmlConfigBaseBuilder<S>> extends ConfigBuilder<S>
XML files based configuration base builder.
Since:
1.0
Version:
1.0, 2025-07
Author:
(w) Iker Hernaez
See Also:
  • Field Details

    • DEFAULT_SEPARATOR

      static final String DEFAULT_SEPARATOR
      The default configuration nested properties separator.
      See Also:
    • DEFAULT_ATTRIBUTE_PREFIX

      static final String DEFAULT_ATTRIBUTE_PREFIX
      The default XML attributes references prefix.
      See Also:
  • Method Details

    • withSeparator

      @NotNull S withSeparator(@NotEmpty @NotEmpty String separator)
      Sets the configuration nested properties separator.
      Parameters:
      separator - The configuration nested properties separator.
      Returns:
      This instance, for method chaining.
    • withAttributePrefix

      @NotNull S withAttributePrefix(@NotEmpty @NotEmpty String prefix)
      Sets the XML attributes references prefix.
      Parameters:
      prefix - The XML attributes references prefix.
      Returns:
      This instance, for method chaining.
    • withEmptyDocument

      @NotNull default S withEmptyDocument(@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.

      Parameters:
      rootElementName - The root element name of the XML document to create.
      Returns:
      This instance, for method chaining.
    • withEmptyDocument

      @NotNull S 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.

      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

      @NotNull S add(@NotNull @NotNull Document values)
      Adds the specified custom properties to the configuration properties.

      Note that property keys will be processed with the configured nested properties separator.

      Parameters:
      values - The configuration properties.
      Returns:
      This instance, for method chaining.
    • add

      @NotNull S add(@NotNull @NotNull Map<String,String> values)
      Adds the specified custom properties to the configuration properties.

      Note that an existing document is required to have been created with withEmptyDocument() or load() 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.

      Parameters:
      values - The configuration properties to add.
      Returns:
      This instance, for method chaining.
    • load

      @NotNull S load(@NotNull @NotNull String path)
      Loads the configuration properties from the specified ClassLoader resource.
      Parameters:
      path - The ClassLoader resource path.
      Returns:
      This instance, for method chaining.
    • load

      @NotNull S load(@NotNull @NotNull Path path)
      Loads the configuration properties from the file in the specified path.
      Parameters:
      path - The file path.
      Returns:
      This instance, for method chaining.
    • load

      @NotNull S load(@NotNull @NotNull File file)
      Loads the configuration properties from the specified file.
      Parameters:
      file - The file to load.
      Returns:
      This instance, for method chaining.
    • load

      @NotNull S load(@NotNull @NotNull URL url)
      Loads the configuration properties from the specified URL.
      Parameters:
      url - The URL to load.
      Returns:
      This instance, for method chaining.