Returns a hierarchical subnode configuration object that wraps the configuration node specified by the given key. This method provides an easy means of accessing sub trees of a hierarchical configuration. In the returned configuration the sub tree can directly be accessed, it becomes the root node of this configuration. Because of this the passed in key must select exactly one configuration node; otherwise an IllegalArgumentException
will be thrown.
The difference between this method and the {@link #subset(String)}
method is that subset()
supports arbitrary subsets of configuration nodes while configurationAt()
only returns a single sub tree. Please refer to the documentation of the SubnodeConfiguration
class to obtain further information about subnode configurations and when they should be used.
With the supportUpdate
flag the behavior of the returned SubnodeConfiguration
regarding updates of its parent configuration can be determined. A subnode configuration operates on the same nodes as its parent, so changes at one configuration are normally directly visible for the other configuration. There are however changes of the parent configuration, which are not recognized by the subnode configuration per default. An example for this is a reload operation (for file-based configurations): Here the complete node set of the parent configuration is replaced, but the subnode configuration still references the old nodes. If such changes should be detected by the subnode configuration, the supportUpdates
flag must be set to true. This causes the subnode configuration to reevaluate the key used for its creation each time it is accessed. This guarantees that the subnode configuration always stays in sync with its key, even if the parent configuration's data significantly changes. If such a change makes the key invalid - because it now no longer points to exactly one node -, the subnode configuration is not reconstructed, but keeps its old data. It is then quasi detached from its parent.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|