NAME
Config::Model::AnyThing - Base class for configuration tree item
SYNOPSIS
package Config::Model::SomeThing ;
use base qw/Config::Model::AnyThing/ ;
DESCRIPTION
This class must be inherited by all nodes or leaves of the configuration tree.
AnyThing provides some methods and no constructor.
Introspection methods
element_name()
Returns the element name that contain this object.
index_value()
For object stored in an array or hash element, returns the index (or key) containing this object.
parent()
Returns the node containing this object. May return undef if parent()
is called on the root of the tree.
location()
Returns the node location in the configuration tree. This location conforms with the syntax defined by "grab()" method.
Information management
grab(...)
Grab an object from the configuration tree. The parameter is a string indicating the steps to follow in the tree to find the required item.
The steps are made of the following items separated by spaces:
- -
-
Go up one node
- !
-
Go to the root node.
- xxx
-
Go down using
xxx
element. - xxx:yy
-
Go down using
xxx
element and idyy
(valid for hash or list elements) - ?xxx
-
Go up the tree until a node containing element
xxx
is found. Then go down the tree like itemxxx
.If
?xxx:yy
, go up the tree the same way. But no check is done to see if idyy
actually exists or not. Only the elementxxx
is considered when going up the tree. - xxx%yy
-
Like
xxx:yy
, but does not create idyy
for elementxxx
. I.e. grab will fail if the idyy
does not already exsits in elementxxx
grab_value(...)
Like "grab(...)", but will return the value of a leaf object, not just the leaf object.
Will raise an exception if following the steps ends on anything but a leaf.
grab_root()
Returns the root of the configuration tree.
search_element( element => <name> [, privilege => ... ] )
From this node (or warped node), search an element (respecting privilege level).
This method returns a Config::Model::Searcher object. See Config::Model::Searcher for details on how to handle a search.
AUTHOR
Dominique Dumont, domi@komarr.grenoble.hp.com
SEE ALSO
Config::Model, Config::Model::Instance, Config::Model::Node, Config::Model::Loader, Config::Model::Dumper