Abstract base class for ConfigValue implementations.
abstract class
|
ConfigValue
|
implements
|
ICodeOutput
|
||
ICodeRange
|
|||||
IEquatable<ConfigValue>
|
|||||
IValidatable
|
|||||
IVersioned
|
public
constant
|
ContextIncludeVirtualFields
=
"include-virtual-fields"
|
||
type
|
string
|
The
boolean
value
false
.
public
static
readonly
field
|
False
|
||
type
|
ConfigValue
|
An invalid value.
public
static
readonly
field
|
Invalid
|
||
type
|
ConfigValue
|
The
null
value
for
ClassType
values.
public
static
readonly
field
|
Null
|
||
type
|
ConfigValue
|
The
number
value
1
.
public
static
readonly
field
|
One
|
||
type
|
ConfigValue
|
The
boolean
value
true
.
public
static
readonly
field
|
True
|
||
type
|
ConfigValue
|
The
number
value
0
.
public
static
readonly
field
|
Zero
|
||
type
|
ConfigValue
|
Accesses the config value, assuming a conversion to Bool exists.
public
virtual
property
|
Bool
{
get
set
}
|
||
type
|
bool
|
||
value
|
The config value. |
See also:
ConfigType.IsBooleanExceptions:
Can the Configure method be called on this config value?
public
property
|
CanConfigure
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
Configure
can
be
called,
false
if
not.
|
Accesses the config value, assuming it is an array value.
public
virtual
property
|
Elements
{
get
}
|
||
type
|
ValueArray
|
||
value
|
|
The config value. |
See also:
ConfigType.IsArrayExceptions:
Returns the config expression that has been evaluated to create this config value.
public
property
|
EvaluatedBy
{
get
}
|
||
type
|
ConfigExpression
|
||
value
|
The
config
expression
or
null
if
not
known
resp.
applicable. |
Accesses the config value, assuming it is a class value.
public
virtual
property
|
Fields
{
get
}
|
||
type
|
IConfigValueBag
|
||
value
|
|
The config value. |
See also:
ConfigType.IsClassExceptions:
public
virtual
property
|
IsInvalid
{
get
}
|
||
type
|
bool
|
||
value
|
public
virtual
property
|
IsNull
{
get
}
|
||
type
|
bool
|
||
value
|
Accesses the config value, assuming a conversion to Num exists.
public
virtual
property
|
Num
{
get
set
}
|
||
type
|
float64
|
||
value
|
The config value. |
See also:
ConfigType.IsNumberExceptions:
Accesses the config value, assuming a conversion to Path exists.
public
virtual
property
|
Path
{
get
set
}
|
||
type
|
Path
|
||
value
|
The config value. |
See also:
ConfigType.IsPathExceptions:
Returns source code range of this object.
public
property
|
Range
{
get
}
|
||
type
|
RangeI
|
||
value
|
The source code character range or Inv if none. | ||
implements
|
ICodeRange.Range
|
Accesses the config value, assuming a conversion to Str exists.
public
virtual
property
|
Str
{
get
set
}
|
||
type
|
string
|
||
value
|
The config value. |
See also:
ConfigType.IsStringExceptions:
public
property
|
SyntaxWeightCtor
{
get
}
|
||
type
|
int32
|
||
value
|
Returns the type of this config property value.
public
abstract
property
|
Type
{
get
}
|
||
type
|
ConfigType
|
||
value
|
|
The type of this property value. |
Returns the current version of object.
public
virtual
property
|
Version
{
get
}
|
||
type
|
int32
|
||
value
|
The current version number. | ||
implements
|
IVersioned.Version
|
Remarks:
For each modification, the version is incremented by at least one.
Parses the given config expression and returns the resulting config value.
public
static
method
|
Evaluate
(string code)
|
||
type
|
ConfigValue
|
||
params
|
code
|
[not-null]
|
The config expression. |
returns
|
|
The config value. |
Creates a new Bool config value object for the the given value.
public
static
method
|
New
(bool value)
|
||
type
|
ConfigValue
|
||
params
|
value
|
The initial value. | |
returns
|
|
The ConfigValue object. |
Creates a new Num config value object for the the given value.
public
static
method
|
New
(float64 value)
|
||
type
|
ConfigValue
|
||
params
|
value
|
The initial value. | |
returns
|
|
The ConfigValue object. |
Creates a new Path config value object for the the given value.
public
static
method
|
New
(Path value)
|
||
type
|
ConfigValue
|
||
params
|
value
|
The initial value. | |
returns
|
|
The ConfigValue object. |
Creates a new Str config value object for the the given value.
public
static
method
|
New
(string value)
|
||
type
|
ConfigValue
|
||
params
|
value
|
The initial value. | |
returns
|
|
The ConfigValue object. |
Creates a new Path config value array for the the given values.
public
static
method
|
NewArray
(bool[] values)
|
||
type
|
ConfigValue
|
||
params
|
values
|
The initial values. | |
returns
|
|
The ConfigValue object. |
Creates a new Path config value array for the the given values.
public
static
method
|
NewArray
(float64[] values)
|
||
type
|
ConfigValue
|
||
params
|
values
|
The initial values. | |
returns
|
|
The ConfigValue object. |
Creates a new Path config value array for the the given values.
public
static
method
|
NewArray
(string[] values)
|
||
type
|
ConfigValue
|
||
params
|
values
|
The initial values. | |
returns
|
|
The ConfigValue object. |
Creates a new Path config value array for the the given values.
public
static
method
|
NewArray
(Path[] values)
|
||
type
|
ConfigValue
|
||
params
|
values
|
The initial values. | |
returns
|
|
The ConfigValue object. |
Caches the given object.
[EmptyBody]
|
||||
public
virtual
method
|
Cache
(object obj)
|
|||
type
|
ConfigValue
|
|||
params
|
obj
|
The native object | ||
returns
|
|
this |
Remarks:
This method can be called after a config value has been constructed for a native object.
Returns the cached object.
[EmptyBody]
|
||||
public
virtual
method
|
Cached
(int32 version)
|
|||
type
|
object
|
|||
params
|
version
|
The config value version. | ||
returns
|
The
cached
native
object
or
null
if
not
present
or
outdated. |
Uses this config value and creates a native object from it.
[OwnerReturn]
|
||||
public
method
|
Configure
()
|
|||
type
|
IConfigurable
|
|||
returns
|
|
The created object. |
Remarks:
An IConfiguratorObject instance must have been specified for the ClassType of this value (see Configurator).
Compares this object with the given one.
[Pure]
|
||||
public
method
|
Equals
(ConfigValue other)
|
|||
type
|
bool
|
|||
params
|
other
|
The object to compare to. | ||
returns
|
true
if
this
object
is
equal
to
other,
false
if
not.
|
|||
implements
|
IEquatable.Equals
|
Returns the value of the given field.
public
method
|
GetField
(string name,
bool notNull = false)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
notNull
|
Call
NotNull
on
field
value?
Defaults
to
false .
|
||
returns
|
|
The field value. |
See also:
FieldsReturns the value of the given field.
public
method
|
GetFieldBool
(string name)
|
||
type
|
bool
|
||
params
|
name
|
[not-null]
|
The field name. |
returns
|
The field value. |
See also:
FieldsReturns the value of the given field.
public
method
|
GetFieldDouble
(string name)
|
||
type
|
float64
|
||
params
|
name
|
[not-null]
|
The field name. |
returns
|
The field value. |
See also:
FieldsReturns the value of the given field.
public
method
|
GetFieldInt
(string name)
|
||
type
|
int32
|
||
params
|
name
|
[not-null]
|
The field name. |
returns
|
The field value. |
See also:
FieldsReturns the value of the given field.
public
method
|
GetFieldPath
(string name,
bool notNull = false)
|
||
type
|
Path
|
||
params
|
name
|
[not-null]
|
The field name. |
notNull
|
Call
NotNull
on
field
value?
Defaults
to
false .
|
||
returns
|
The field value. |
See also:
FieldsReturns the value of the given field.
public
method
|
GetFieldStr
(string name,
bool notNull = false)
|
||
type
|
string
|
||
params
|
name
|
[not-null]
|
The field name. |
notNull
|
Call
NotNull
on
field
value?
Defaults
to
false .
|
||
returns
|
The field value. |
See also:
FieldsChecks if this config value has a field named name that has a non-null value.
public
method
|
IsFieldNull
(string name)
|
||
type
|
bool
|
||
params
|
name
|
[not-null]
|
The field name. |
returns
|
true
if
the
field
name
exists
and
has
a
non-null
value,
false
otherwise.
|
Creates a new instance of the given nullable type and sets this value to the resulting value.
public
virtual
method
|
New
(ConfigType type = null)
|
||
type
|
ConfigValue
|
||
params
|
type
|
The
nullable
type
to
instantiate
or
null
to
use
the
value
base
type.
|
|
returns
|
|
this |
Throws a ConfigException if this config value is Null.
public
method
|
NotNull
()
|
||
type
|
ConfigValue
|
||
returns
|
|
this |
Exceptions:
Sets the value to the given value.
public
virtual
method
|
Set
(ConfigValue value)
|
||
type
|
ConfigValue
|
||
params
|
value
|
[not-null]
|
The other value. |
returns
|
|
this |
Sets the value of the given field.
public
method
|
SetField
(string name,
ConfigValue value)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
value
|
[not-null]
|
The field value. | |
returns
|
|
this |
See also:
FieldsSets the value of the given field.
public
method
|
SetField
(string name,
IConfigurable value)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
value
|
The field value. | ||
returns
|
|
this |
See also:
FieldsSets the value of the given field.
public
method
|
SetFieldBool
(string name,
bool value)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
value
|
The field value. | ||
returns
|
|
this |
See also:
FieldsSets the value of the given field.
public
method
|
SetFieldNum
(string name,
float64 value)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
value
|
The field value. | ||
returns
|
|
this |
See also:
FieldsSets the value of the given field.
public
method
|
SetFieldPath
(string name,
Path value)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
value
|
The field value. | ||
returns
|
|
this |
See also:
FieldsSets the value of the given field.
public
method
|
SetFieldStr
(string name,
string value)
|
||
type
|
ConfigValue
|
||
params
|
name
|
[not-null]
|
The field name. |
value
|
The field value. | ||
returns
|
|
this |
See also:
Fields
[Pure]
|
||||
public
override
method
|
ToString
()
|
|||
type
|
string
|
public
method
|
ToString
(bool includeVirtualFields)
|
||
type
|
string
|
||
params
|
includeVirtualFields
|
Validates the state of this object.
public
method
|
Validate
(Validator validator)
|
||
params
|
validator
|
[not-null]
|
The validator object. |
implements
|
IValidatable.Validate
|
Flushes all cached validation results.
public
virtual
method
|
ValidateFlush
()
|
Remarks:
Call this method when external changes have taken place, such as file deletions / creations.
Produces source code by feeding the given source code writer.
public
abstract
method
|
WriteSourceCode
(SourceCodeWriter writer,
Context context)
|
||
params
|
writer
|
[not-null]
|
The source code writer to use. |
context
|
[not-null]
|
Context information. | |
implements
|
ICodeOutput.WriteSourceCode
|
protected
abstract
property
|
DoSyntaxWeightCtor
{
get
}
|
||
type
|
int32
|
||
value
|
protected
constructor
|
ConfigValue
()
|
Compares this config value and the given one for equality.
protected
abstract
method
|
DoEquals
(ConfigValue other)
|
||
type
|
bool
|
||
params
|
other
|
The
other
config
value.
This
will
never
be
null .
Also,
the
types
of
this
config
value
and
the
given
one
are
mutually
convertible
to
each
other.
|
|
returns
|
true
if
both
config
values
are
equal,
false
if
not. |
[EmptyBody]
|
||||
protected
virtual
method
|
DoValidate
(Validator validator)
|
|||
params
|
validator
|