Zum Hauptinhalt springen

DisplayRuleParseResult

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.DisplayRules

Result of parsing a display rule: the segment list, collected syntax errors and the distinct set of referenced attribute paths.

public sealed class DisplayRuleParseResult

Inheritance Object → DisplayRuleParseResult

Properties​

Segments​

The parsed literal and placeholder segments in rule order.

public IReadOnlyList<DisplayRuleSegment> Segments { get; }

Property Value​

IReadOnlyList<DisplayRuleSegment>

Errors​

Syntax errors collected while parsing; empty when the rule is valid.

public IReadOnlyList<string> Errors { get; }

Property Value​

IReadOnlyList<String>

IsValid​

True when the rule parsed without errors.

public bool IsValid { get; }

Property Value​

Boolean

ReferencedPaths​

Distinct attribute paths referenced by the rule, in order of first occurrence. Record paths are dot-separated (e.g. "thermalRequirements.spaceTemperature").

public IReadOnlyCollection<string> ReferencedPaths { get; }

Property Value​

IReadOnlyCollection<String>

Methods​

Evaluate(Func<String, Object>)​

Evaluates the rule against attribute values. Each placeholder resolves to the first path in its coalesce chain that yields a non-empty value. Returns null when every placeholder evaluated empty (the caller then falls back to its own default) or when the overall result is blank.

public string Evaluate(Func<string, object> resolveValue)

Parameters​

resolveValue Func<String, Object>
Resolves an attribute path to its current value (null when unset)

Returns​

String