Interface IConfigSectionNode
Provides read-only configuration section node abstraction
Assembly: Azos.dll
Syntax
public interface IConfigSectionNode : IConfigNode, INamed
Properties
AttrCount
Returns number of child attribute nodes
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Attributes
Enumerates all attribute nodes
Declaration
IEnumerable<IConfigAttrNode> Attributes { get; }
Property Value
ChildCount
Returns number of child section nodes
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Children
Enumerates all child nodes
Declaration
IEnumerable<IConfigSectionNode> Children { get; }
Property Value
HasAttributes
Indicates whether this node has any associated attributes
Declaration
bool HasAttributes { get; }
Property Value
Type |
Description |
System.Boolean |
|
HasChildren
Indicates whether this node has any child section nodes
Declaration
bool HasChildren { get; }
Property Value
Type |
Description |
System.Boolean |
|
Item[Int32]
Retrieves section node by index or empty node instance if section node with such index could not be found
Declaration
IConfigSectionNode this[int idx] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
idx |
|
Property Value
Item[String[]]
Retrieves section node by names, from left to right until existing node is found.
If no existing node could be found then empty node instance is returned
Declaration
IConfigSectionNode this[params string[] names] { get; }
Parameters
Type |
Name |
Description |
System.String[] |
names |
|
Property Value
Methods
AttrByIndex(Int32)
Returns attribute node by its index or empty attribute if real attribute with such index does not exist
Declaration
IConfigAttrNode AttrByIndex(int idx)
Parameters
Type |
Name |
Description |
System.Int32 |
idx |
|
Returns
AttrByName(String, Boolean)
Returns attribute node by its name or empty attribute if real attribute with such name does not exist
Declaration
IConfigAttrNode AttrByName(string name, bool autoCreate = false)
Parameters
Type |
Name |
Description |
System.String |
name |
|
System.Boolean |
autoCreate |
|
Returns
AttrsToStringMap(Boolean)
Returns attribute values as string map
Declaration
StringMap AttrsToStringMap(bool verbatim = false)
Parameters
Type |
Name |
Description |
System.Boolean |
verbatim |
|
Returns
EvaluateValueVariables(String)
Evaluates a value string expanding all variables with var-paths relative to this node.
Evaluates configuration variables such as "$(varname)" or "$(@varname)". Varnames are paths
to other config nodes from the same configuration or variable names when prefixed with "". If varname starts with "@" then it gets combined
with input as path string. "" is used to qualify environment vars that get resolved through Configuration.EnvironmentVarResolver
Example: ....add key="Schema.$(/A/B/C/$attr)" value="$(@~HOME)bin\Transforms\"...
Declaration
string EvaluateValueVariables(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
Type |
Description |
System.String |
|
IsSameNameAttr(IConfigSectionNode)
Returns true when this and another nodes both have attribute "name" and their values are equal per case-insensitive culture-neutral comparison
Declaration
bool IsSameNameAttr(IConfigSectionNode other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsSameNameAttr(String)
Returns true when this node has an attribute called "name" and its value is equal to the supplied value per case-insensitive culture-neutral comparison
Declaration
bool IsSameNameAttr(string other)
Parameters
Type |
Name |
Description |
System.String |
other |
|
Returns
Type |
Description |
System.Boolean |
|
Navigate(String)
Navigates the path and return the appropriate node. Example '!/azos/logger/destination/$file-name'
Declaration
IConfigNode Navigate(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
If path starts from '!' then exception will be thrown if such a node does not exist;
Use '/' as leading char for root,
'..' for step up,
'$' for attribute name. Multiple paths may be coalesced using '|' or ';'
|
Returns
NavigateSection(String)
Navigates the path and return the appropriate section node. Example '!/azos/logger/destination'
Declaration
IConfigSectionNode NavigateSection(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
If path starts from '!' then exception will be thrown if such a section node does not exist;
Use '/' as leading char for root,
'..' for step up. Multiple paths may be coalesced using '|' or ';'
|
Returns
ToConfigurationJSONDataMap()
Returns the contents of this node per JSONConfiguration specification. Contrast with ToJSONDataMap
Declaration
JSONDataMap ToConfigurationJSONDataMap()
Returns
ToJSONDataMap()
Converts this ConfigSectionNode to JSONDataMap. Contrast with ToConfigurationJSONDataMap
Be careful: that this operation can "loose" data from ConfigSectionNode.
In other words some ConfigSectionNode information can not be reflected in corresponding JSONDataMap, for example
this method overwrites duplicate key names and does not support section values
Declaration
JSONDataMap ToJSONDataMap()
Returns
ToJSONString(JSONWritingOptions)
Serializes configuration tree rooted at this node into JSON configuration format and returns it as a string
Declaration
string ToJSONString(JSONWritingOptions options = null)
Parameters
Returns
Type |
Description |
System.String |
|
ToLaconicString(LaconfigWritingOptions)
Serializes configuration tree rooted at this node into Laconic format and returns it as a string
Declaration
string ToLaconicString(LaconfigWritingOptions options = null)
Parameters
Returns
Type |
Description |
System.String |
|
ToXmlDoc(String, String)
Serializes configuration tree as XML
Declaration
XmlDocument ToXmlDoc(string xsl = null, string encoding = null)
Parameters
Type |
Name |
Description |
System.String |
xsl |
|
System.String |
encoding |
|
Returns
Type |
Description |
System.Xml.XmlDocument |
|
ToXmlString(String)
Serializes configuration tree as XML string with optional link to xsl file
Declaration
string ToXmlString(string xsl = null)
Parameters
Type |
Name |
Description |
System.String |
xsl |
|
Returns
Type |
Description |
System.String |
|
Extension Methods