Class CombinedConfiguration.ConfigData

  • Enclosing class:
    CombinedConfiguration

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

      Fields 
      Modifier and Type Field Description
      private java.lang.String at
      Stores the at string.
      private java.util.Collection<java.lang.String> atPath
      Stores the at information as path of nodes.
      private Configuration configuration
      Stores a reference to the configuration.
      private java.lang.String name
      Stores the name under which the configuration is stored.
      private ImmutableNode rootNode
      Stores the root node for this child configuration.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigData​(Configuration config, java.lang.String n, java.lang.String at)
      Creates a new instance of ConfigData and initializes it.
    • Field Detail

      • configuration

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

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

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

        private final java.lang.String at
        Stores the at string.
      • rootNode

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

      • ConfigData

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

      • getAt

        public java.lang.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 java.lang.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 java.util.Collection<java.lang.String> parseAt​(java.lang.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,
                                            java.lang.String currentComponent,
                                            java.util.Iterator<java.lang.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