Class CombinedConfiguration.ConfigData
- java.lang.Object
-
- org.apache.commons.configuration2.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 ofConfigData
and initializes it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAt()
Gets the at position of this configuration.Configuration
getConfiguration()
Gets the stored configuration.java.lang.String
getName()
Gets the configuration's name.ImmutableNode
getRootNode()
Gets the root node for this child configuration.private ImmutableNode
getRootNodeOfConfiguration()
Obtains the root node of the wrapped configuration.ImmutableNode
getTransformedRoot()
Gets the transformed root node of the stored configuration.private java.util.Collection<java.lang.String>
parseAt(java.lang.String at)
Splits the at path into its components.private ImmutableNode
prependAtPath(ImmutableNode node)
Prepends the at path to the given node.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.
-
-
-
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 ofConfigData
and initializes it.- Parameters:
config
- the configurationn
- the nameat
- 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 objectcurrentComponent
- the name of the current path componentcomponents
- an iterator with all components of the at pathorgRoot
- the original root node of the wrapped configuration
-
-