Skip to content

EF.YAML.AttributeUtils ​

RTTI-based discovery utilities for YAML-mapped properties. Used by KIDE to enumerate a class's YAML metadata at runtime, replacing the external MetadataTemplates YAML files.

TYamlPropertyInfo record ​

Describes a single YAML-mapped property discovered via RTTI.

TYamlEnumValueInfo record ​

Describes a single enum value mapping (YAML string to ordinal).

TYamlConfigNodeInfo record ​

Maps a config node path (from a class-level YamlConfigNode attribute) to the class that reads/describes it. Built by scanning the linked types.

TYamlChildTypeInfo record ​

Describes a child type that can be added to a container class.

TYamlAttributeReader class ​

Static utility class for discovering YAML attributes via RTTI.

pascal
class function GetYamlProperties(AClass: TClass): TArray<TYamlPropertyInfo>;

Enumerates all properties of AClass that carry a YAML attribute, returning a sorted array of TYamlPropertyInfo records. Properties are sorted: Required first, then by NodePath alphabetically.

pascal
class function GetYamlAttribute(AProp: TRttiProperty): TCustomAttribute;

Returns the YAML attribute on a specific property, or nil if none. The returned object is owned by the RTTI system — do not free it.

pascal
class function IsYamlMapped(AProp: TRttiProperty): Boolean;

Quick check: returns True if the property carries any YAML attribute.

pascal
class function GetYamlEnumValues(ATypeInfo: PTypeInfo): TArray<TYamlEnumValueInfo>;

Reads YamlEnumValue attributes from an enumerated type. Returns one entry per enum ordinal, in ordinal order. If ATypeInfo is not an enum or has no YamlEnumValue attributes, returns an empty array.

pascal
class function YamlValueToOrdinal(ATypeInfo: PTypeInfo;

Converts a YAML string value to the corresponding enum ordinal, using YamlEnumValue attributes on the enum type. Raises an exception if the value is not found.

pascal
class function OrdinalToYamlValue(ATypeInfo: PTypeInfo;

Converts an enum ordinal to its YAML string representation, using YamlEnumValue attributes on the enum type. Raises an exception if the ordinal has no YamlEnumValue attribute.

pascal
class function GetYamlChildTypes(AClass: TClass): TArray<TYamlChildTypeInfo>;

Reads YamlChildType attributes from a container class. Returns one entry per child type, in declaration order. If AClass has no YamlChildType attributes, returns an empty array.

pascal
class function GetConfigNodePath(AClass: TClass): string;

Returns the node path declared by a class-level YamlConfigNode attribute, or '' if the class has none.

pascal
class function GetConfigNodeClasses: TArray<TYamlConfigNodeInfo>;

Scans all linked RTTI types for classes carrying a YamlConfigNode attribute and returns their NodePath -> class mapping. Used by KIDE to discover config classes that live in their own feature/domain unit (no parent YamlSubNode type-reference). Enumerates all types, so callers should cache the result (call once).

Released under Apache License, Version 2.0.