Class CombinedConfiguration.ConfigData

java.lang.Object
org.apache.commons.configuration2.CombinedConfiguration.ConfigData
Enclosing class:
CombinedConfiguration

private final class CombinedConfiguration.ConfigData extends Object
An internal helper class for storing information about contained configurations.
  • Field Details

    • configuration

      private final Configuration configuration
      Stores a reference to the configuration.
    • name

      private final String name
      Stores the name under which the configuration is stored.
    • atPath

      private final Collection<String> atPath
      Stores the at information as path of nodes.
    • at

      private final String at
      Stores the at string.
    • rootNode

      private ImmutableNode rootNode
      Stores the root node for this child configuration.
  • Constructor Details

    • ConfigData

      public ConfigData(Configuration config, String n, String at)
      Creates a new instance of ConfigData and initializes it.
      Parameters:
      config - the configuration
      n - the name
      at - the at position
  • Method Details

    • getAt

      public String getAt()
      Gets the at position of this configuration.
      Returns:
      the at position
    • getConfiguration

      public Configuration getConfiguration()
      Gets the stored configuration.
      Returns:
      the configuration
    • getName

      public String getName()
      Gets the configuration's name.
      Returns:
      the name
    • getRootNode

      public ImmutableNode getRootNode()
      Gets the root node for this child configuration.
      Returns:
      the root node of this child configuration
      Since:
      1.5
    • getRootNodeOfConfiguration

      private ImmutableNode getRootNodeOfConfiguration()
      Obtains the root node of the wrapped configuration. If necessary, a hierarchical representation of the configuration has to be created first.
      Returns:
      the root node of the associated configuration
    • getTransformedRoot

      public ImmutableNode getTransformedRoot()
      Gets the transformed root node of the stored configuration. The term "transformed" means that an eventually defined at path has been applied.
      Returns:
      the transformed root node
    • parseAt

      private Collection<String> parseAt(String at)
      Splits the at path into its components.
      Parameters:
      at - the at string
      Returns:
      a collection with the names of the single components
    • prependAtPath

      private ImmutableNode prependAtPath(ImmutableNode node)
      Prepends the at path to the given node.
      Parameters:
      node - the root node of the represented configuration
      Returns:
      the new root node including the at path
    • prependAtPathComponent

      private void prependAtPathComponent(ImmutableNode.Builder builder, String currentComponent, Iterator<String> components, ImmutableNode orgRoot)
      Handles a single component of the at path. A corresponding node is created and added to the hierarchical path to the original root node of the configuration.
      Parameters:
      builder - the current node builder object
      currentComponent - the name of the current path component
      components - an iterator with all components of the at path
      orgRoot - the original root node of the wrapped configuration