Class CombinedConfiguration.ConfigData
java.lang.Object
org.apache.commons.configuration2.CombinedConfiguration.ConfigData
- Enclosing class:
CombinedConfiguration
An internal helper class for storing information about contained configurations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
Stores the at string.private final Collection
<String> Stores the at information as path of nodes.private final Configuration
Stores a reference to the configuration.private final String
Stores the name under which the configuration is stored.private ImmutableNode
Stores the root node for this child configuration. -
Constructor Summary
ConstructorsConstructorDescriptionConfigData
(Configuration config, String n, String at) Creates a new instance ofConfigData
and initializes it. -
Method Summary
Modifier and TypeMethodDescriptiongetAt()
Gets the at position of this configuration.Gets the stored configuration.getName()
Gets the configuration's name.Gets the root node for this child configuration.private ImmutableNode
Obtains the root node of the wrapped configuration.Gets the transformed root node of the stored configuration.private Collection
<String> 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, String currentComponent, Iterator<String> components, ImmutableNode orgRoot) Handles a single component of the at path.
-
Field Details
-
configuration
Stores a reference to the configuration. -
name
Stores the name under which the configuration is stored. -
atPath
Stores the at information as path of nodes. -
at
Stores the at string. -
rootNode
Stores the root node for this child configuration.
-
-
Constructor Details
-
ConfigData
Creates a new instance ofConfigData
and initializes it.- Parameters:
config
- the configurationn
- the nameat
- the at position
-
-
Method Details
-
getAt
Gets the at position of this configuration.- Returns:
- the at position
-
getConfiguration
Gets the stored configuration.- Returns:
- the configuration
-
getName
Gets the configuration's name.- Returns:
- the name
-
getRootNode
Gets the root node for this child configuration.- Returns:
- the root node of this child configuration
- Since:
- 1.5
-
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
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
Splits the at path into its components.- Parameters:
at
- the at string- Returns:
- a collection with the names of the single components
-
prependAtPath
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 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
-