YamlParser class
A parser for YAML configuration files.
Supports YAML syntax including nested structures, lists, and comments. Preserves special property values like #{} and @{} for later resolution.
#{} and @{} are used to preserve special property values like #{} and @{} for later resolution.
Example usage:
void main() {
final parser = YamlParser();
final config = parser.parse('key: value');
print(config['key']); // Output: value
final config = parser.parseAsset(asset);
print(config['key']); // Output: value
final config = parser.parseFile('config.yaml');
print(config['key']); // Output: value
}
Constructors
- YamlParser()
- A parser for YAML configuration files.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String source) → Map< String, dynamic> -
Parses the given
source
string into aMap<String, dynamic>
.override -
parseAs(
Asset asset) → Object -
Parses the given
Asset
and returns it as a generic Object.inherited -
parseAsset(
Asset asset) → Map< String, dynamic> -
Parses a Jetleaf
Asset
into aMap<String, dynamic>
.override -
parseFile(
String path) → Map< String, dynamic> -
Optionally parses configuration directly from a file located at
path
.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited