Class XmlConfigOptions

java.lang.Object
dev.orne.config.impl.XmlConfigOptions

@API(status=INTERNAL, since="1.0") public class XmlConfigOptions extends Object
Options of XML based configuration builder.
Since:
1.0
Version:
1.0, 2025-07
Author:
(w) Iker Hernaez
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor.
    Copy constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(@NotNull Document values)
    Adds the specified configuration properties to the configuration properties.
    @NotBlank String
    Returns the XML attributes references prefix.
    @NotNull Document
    Returns the XML document with the configuration properties.
    @NotBlank String
    Returns the configuration nested properties separator.
    void
    load(@NotNull File file)
    Loads the configuration properties from the specified file.
    void
    load(@NotNull InputStream docIS)
    Loads the configuration properties from the specified InputStream.
    void
    load(@NotNull String path)
    Loads the configuration properties from the specified ClassLoader resource.
    void
    load(@NotNull URL url)
    Loads the configuration properties from the specified URL.
    void
    load(@NotNull Path path)
    Loads the configuration properties from the file in the specified path.
    void
    setAttributePrefix(@NotBlank String prefix)
    Sets the XML attributes references prefix.
    void
    setPropertySeparator(@NotBlank String separator)
    Sets the configuration nested properties separator.
    void
    setRootElement(String namespaceURI, @NotNull String localName)
    Creates an empty XML document with the specified root element name as configuration properties container.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • XmlConfigOptions

      public XmlConfigOptions()
      Empty constructor.
    • XmlConfigOptions

      public XmlConfigOptions(@NotNull @NotNull XmlConfigOptions copy)
      Copy constructor.
      Parameters:
      copy - The instance to copy.
  • Method Details

    • getDocument

      @NotNull public @NotNull Document getDocument()
      Returns the XML document with the configuration properties.
      Returns:
      The XML document with the configuration properties.
    • getPropertySeparator

      @NotBlank public @NotBlank String getPropertySeparator()
      Returns the configuration nested properties separator.
      Returns:
      The configuration nested properties separator.
    • setPropertySeparator

      public void setPropertySeparator(@NotBlank @NotBlank String separator)
      Sets the configuration nested properties separator.
      Parameters:
      separator - The configuration nested properties separator.
    • getAttributePrefix

      @NotBlank public @NotBlank String getAttributePrefix()
      Returns the XML attributes references prefix.
      Returns:
      The XML attributes references prefix.
    • setAttributePrefix

      public void setAttributePrefix(@NotBlank @NotBlank String prefix)
      Sets the XML attributes references prefix.
      Parameters:
      prefix - The XML attributes references prefix.
    • setRootElement

      public void setRootElement(String namespaceURI, @NotNull @NotNull String localName)
      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, or null if the XML document does not use namespaces.
      localName - The root element name of the XML document to create.
    • add

      public void add(@NotNull @NotNull Document values)
      Adds the specified configuration properties to the configuration properties.
      Parameters:
      values - The configuration properties.
    • load

      public void load(@NotNull @NotNull String path)
      Loads the configuration properties from the specified ClassLoader resource.
      Parameters:
      path - The ClassLoader resource path.
    • load

      public void load(@NotNull @NotNull Path path)
      Loads the configuration properties from the file in the specified path.
      Parameters:
      path - The file path.
    • load

      public void load(@NotNull @NotNull File file)
      Loads the configuration properties from the specified file.
      Parameters:
      file - The file to load.
    • load

      public void load(@NotNull @NotNull URL url)
      Loads the configuration properties from the specified URL.
      Parameters:
      url - The URL to load.
    • load

      public void load(@NotNull @NotNull InputStream docIS)
      Loads the configuration properties from the specified InputStream.
      Parameters:
      docIS - The XML document input stream.