A specialized hierarchical configuration class that wraps a single node of
its parent configuration.
Configurations of this type are initialized with a parent configuration and a
configuration node of this configuration. This node becomes the root node of
the subnode configuration. All property accessor methods are evaluated
relative to this root node. A good use case for a
SubnodeConfiguration is when multiple properties from a
specific sub tree of the whole configuration need to be accessed. Then a
SubnodeConfiguration can be created with the parent node of
the affected sub tree as root node. This allows for simpler property keys and
is also more efficient.
A subnode configuration and its parent configuration operate on the same
hierarchy of configuration nodes. So if modifications are performed at the
subnode configuration, these changes are immideately visible in the parent
configuration. Analogously will updates of the parent configuration affect
the subnode configuration if the sub tree spanned by the subnode
configuration's root node is involved.
When a subnode configuration is created, it inherits the settings of its
parent configuration, e.g. some flags like the
throwExceptionOnMissing flag or the settings for handling list
delimiters) or the expression engine. If these settings are changed later in
either the subnode or the parent configuration, the changes are not visible
for each other. So you could create a subnode configuration, change its
expression engine without affecting the parent configuration.
From its purpose this class is quite similar to
SubsetConfiguration . The difference is that a subset
configuration of a hierarchical configuration may combine multiple
configuration nodes from different sub trees of the configuration, while all
nodes in a subnode configuration belong to the same sub tree. If an
application can live with this limitation, it is recommended to use this
class instead of SubsetConfiguration because creating a subset
configuration is more expensive than creating a subnode configuration.
since: 1.3 author: Oliver Heger version: $Id: SubnodeConfiguration.java 439648 2006-09-02 20:42:10Z oheger $ |