1Config::Model::AnyThingU(s3e)r Contributed Perl DocumentaCtoinofnig::Model::AnyThing(3)
2
3
4

NAME

6       Config::Model::AnyThing - Base class for configuration tree item
7

VERSION

9       version 2.152
10

SYNOPSIS

12        # internal class
13

DESCRIPTION

15       This class must be inherited by all nodes or leaves of the
16       configuration tree.
17
18       AnyThing provides some methods and no constructor.
19

Introspection methods

21   element_name
22       Returns the element name that contain this object.
23
24   index_value
25       For object stored in an array or hash element, returns the index (or
26       key) containing this object.
27
28   parent
29       Returns the node containing this object. May return undef if "parent"
30       is called on the root of the tree.
31
32   container
33       A bit like parent, this method returns the element containing this
34       object. See "container_type"
35
36   container_type
37       Returns the type (e.g. "list" or "hash" or "leaf" or "node" or
38       "warped_node") of the element containing this object.
39
40   root
41       Returns the root node of the configuration tree.
42
43   location
44       Returns the node location in the configuration tree. This location
45       conforms with the syntax defined by grab method.
46
47   location_short
48       Returns the node location in the configuration tree. This location
49       truncates long indexes to be readable. It cannot be used by grab
50       method.
51
52   composite_name
53       Return the element name with its index (if any). I.e. returns "foo:bar"
54       or "foo".
55
56   composite_name_short
57       Return the element name with its index (if any). Too long indexes are
58       truncated to be readable.
59

Annotation

61       Annotation is a way to store miscellaneous information associated to
62       each node. (Yeah... comments). Reading and writing annotation makes
63       sense only if they can be read from and written to the configuration
64       file, hence the need for the following method:
65
66   backend_support_annotation
67       Returns 1 if at least one of the backends attached to a parent node
68       support to read and write annotations (aka comments) in the
69       configuration file.
70
71   support_annotation
72       Returns 1 if at least one of the backends support to read and write
73       annotations (aka comments) in the configuration file.
74
75   annotation
76       Parameters: "( [ note1, [ note2 , ... ] ] )"
77
78       Without argument, return a string containing the object's annotation
79       (or an empty string).
80
81       With several arguments, join the arguments with "\n", store the
82       annotations and return the resulting string.
83
84   load_pod_annotation
85       Parameters: "( pod_string )"
86
87       Load annotations in configuration tree from a pod document. The pod
88       must be in the form:
89
90        =over
91
92        =item path
93
94        Annotation text
95
96        =back
97
98   clear_annotation
99       Clear the annotation of an element
100

Information management

102   notify_change
103       Notify the instance of semantic changes. Parameters are:
104
105       old     old value. (optional)
106
107       new     new value (optional)
108
109       path    Location of the changed parameter starting from root node.
110               Default to "$self-"location>.
111
112       name    element name. Default to "$self-"element_name>
113
114       index   If the changed parameter is part of a hash or an array, "index"
115               contains the key or the index to get the changed parameter.
116
117       note    information about the change. Mandatory when neither old or new
118               value are defined.
119
120       really  When set to 1, force recording of change even if in initial
121               load phase.
122
123       needs_save
124               internal parameter.
125
126   show_message
127       Parameters: "( string )"
128
129       Forwarded to "show_message" in Config::Model::Instance.
130
131   root_path
132       Forwarded to "root_path" in Config::Model::Instance.
133
134   model_searcher
135       Returns an object dedicated to search an element in the configuration
136       model.
137
138       This method returns a Config::Model::SearchElement object. See
139       Config::Model::Searcher for details on how to handle a search.
140
141   dump_as_data
142       Dumps the configuration data of the node and its siblings into a perl
143       data structure.
144
145       Returns a hash ref containing the data. See Config::Model::DumpAsData
146       for details.
147
148   warp_error
149       Returns a string describing any issue with Config::Model::Warper
150       object.  Returns '' if invoked on a tree object without warp
151       specification.
152

AUTHOR

154       Dominique Dumont, (ddumont at cpan dot org)
155

SEE ALSO

157       Config::Model, Config::Model::Instance, Config::Model::Node,
158       Config::Model::Loader, Config::Model::Dumper
159

AUTHOR

161       Dominique Dumont
162
164       This software is Copyright (c) 2005-2022 by Dominique Dumont.
165
166       This is free software, licensed under:
167
168         The GNU Lesser General Public License, Version 2.1, February 1999
169
170
171
172perl v5.36.0                      2022-08-10        Config::Model::AnyThing(3)
Impressum