internal package
Foswiki::Configure::Item
On this page:
- package Foswiki::Configure::Item
- ObjectMethod getDepth() → $integer
- ObjectMethod addToDesc($str)
- ObjectMethod isExpertsOnly() → $boolean
- ObjectMethod set(%params)
- ObjectMethod inc($key)
- ObjectMethod getSectionObject($head, $depth) → $item
- ObjectMethod getValueObject($keys) → $value
- ObjectMethod needsSaving() → $integer
- ObjectMethod visit($visitor) → $boolean
package Foswiki::Configure::Item
Abstract base class of all configuration components. A configuration component may be a collection item (a ConfigSection), an individual Value, or a checker associated with a value (or a node in a checker tree). Objects of this class are intended to form a tree with references in both directions, circular references ahead. But configure isn't supposed to be run in a persistent environment anyway. ObjectMethod
getDepth() → $integer
Get the depth of the item in the item tree, where the root is at depth 0,
it's children at depth 1, etc.
ObjectMethod
addToDesc($str)
Concatenate $str to the description of this item.
ObjectMethod
isExpertsOnly() → $boolean
Is the item tagged EXPERT?
By default, no node is expert.
ObjectMethod
set(%params)
Accept an attribute setting for this item (e.g. a key name).
Sort of a generic write accessor.
ObjectMethod
inc($key)
Increment a numeric value identified by $key, recursing up the tree to the
root.
Assumptions - All item levels have $key defined and initialized
- Parents of items are items (or more precisely: can inc())
ObjectMethod
getSectionObject($head, $depth) → $item
This gets the section object that has the heading $head and
getDepth() == $depth below this item.
Subclasses must provide an implementation.
ObjectMethod
getValueObject($keys) → $value
Get the first Value object associated with this item. The default
implementation is the tree node implementation; it just queries
children. Keys are only present on leaf items.
Subclasses must define this method.
ObjectMethod
needsSaving() → $integer
Return the number of items in this subtree that need saving.
The default implementation always returns 0
ObjectMethod
visit($visitor) → $boolean
Start a visit over this item. - $visitor - an object that implements Foswiki::Configure::Visitor