blib/lib/Config/Model/models/Itself/Element.pl

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 26 / 26 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Config/Model/models/Itself/CommonElement.pl ↑ Summary blib/lib/Config/Model/models/Itself/MigratedValue.pl »
1 1 ▶#
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶# This file is part of Config-Model-Itself
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 #
4 # This software is Copyright (c) 2007-2026 by Dominique Dumont.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 # Copyright (c) 2007-2008 Dominique Dumont.
11 #
12 # This file is part of Config-Model-Itself.
13 #
14 # Config-Model-Itself is free software; you can redistribute it
15 # and/or modify it under the terms of the GNU Lesser Public License
16 # as published by the Free Software Foundation; either version 2.1
17 # of the License, or (at your option) any later version.
18 #
19 # Config-Model-Itself is distributed in the hope that it will be
20 # useful, but WITHOUT ANY WARRANTY; without even the implied
21 # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 # See the GNU Lesser Public License for more details.
23 #
24 # You should have received a copy of the GNU Lesser Public License
25 # along with Config-Model-Itself; if not, write to the Free Software
26 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27  
28 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
29 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 return [
32 [
33 6 name => "Itself::Element",
34  
35 include => ['Itself::NonWarpableElement' ,'Itself::WarpableElement'],
36 include_after => 'type' ,
37  
38 gist => '{level} {status} {type}',
39  
40 'element'
41 => [
42  
43 # structural information
44 'type' => { type => 'leaf',
45 value_type => 'enum',
46 choice => [qw/node warped_node hash list leaf check_list/],
47 mandatory => 1 ,
48 description => 'specify the type of the configuration element.'
49 . 'Leaf is used for plain value.',
50 },
51  
52 # all elements
53 'status'
54 => {
55 type => 'leaf',
56 value_type => 'enum',
57 choice => [qw/obsolete deprecated standard/],
58 upstream_default => 'standard' ,
59 },
60  
61 'level'
62 => {
63 type => 'leaf',
64 value_type => 'enum',
65 choice => [qw/important normal hidden/] ,
66 upstream_default => 'normal',
67 description => 'Used to highlight important parameter or to hide others. Hidden parameter are mostly used to hide features that are unavailable at start time. They can be made available later using warp mechanism',
68 },
69  
70 'summary'
71 => {
72 type => 'leaf',
73 value_type => 'uniline',
74 description => 'enter short information regarding this element',
75 },
76  
77 'description'
78 => {
79 type => 'leaf',
80 value_type => 'string',
81 description => 'enter detailed help information regarding this element',
82 },
83  
84 # all but node or warped_node
85 'warp' => {
86 type => 'warped_node',
87 level => 'hidden',
88 config_class_name => 'Itself::WarpValue',
89 warp => {
90 follow => { elt_type => '- type' },
91 rules => [{
92 when => '$elt_type ne "node"',
93 apply => { level => 'normal' }
94 }]
95 },
96 description => "change the properties (i.e. default value or its value_type) dynamically according to the value of another Value object located elsewhere in the configuration tree. "
97 },
98  
99 # hash or list
100 'index_type'
101 => { type => 'leaf',
102 value_type => 'enum',
103 level => 'hidden' ,
104 warp => {
105 follow => { type => '?type'},
106 'rules' => [{
107 when => '$type eq "hash"',
108 apply => {
109 level => 'important',
110 mandatory => 1,
111 choice => [qw/string integer/] ,
112 }
113 }]
114 },
115 description => 'Specify the type of allowed index for the hash. "String" means no restriction.',
116 },
117  
118 'cargo' => {
119 type => 'warped_node',
120 level => 'hidden',
121 warp => {
122 follow => { 't' => '- type' },
123 'rules' => [{
124 when => '$t eq "list" or $t eq "hash"',
125 apply => {
126 level => 'normal',
127 config_class_name => 'Itself::CargoElement',
128 },
129 }],
130 },
131 description => 'Specify the properties of the configuration element configuration in this hash or list',
132 }
133 ],
134 ],
135 ];
« blib/lib/Config/Model/models/Itself/CommonElement.pl ↑ Summary blib/lib/Config/Model/models/Itself/MigratedValue.pl »