KdlDocument class

KDL Root node

Mixed-in types

Constructors

KdlDocument([List<KdlNode>? initialNodes])
Create a new KdlDocument with the given nodes

Properties

first KdlNode
The first element.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<KdlNode>
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last KdlNode
The last element.
no setterinherited
length int
The number of elements in this Iterable.
no setterinherited
nodes List<KdlNode>
Top level nodes
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single KdlNode
Checks that this iterable has only one element, and returns that element.
no setterinherited

Methods

any(bool test(KdlNode element)) bool
Checks whether any element of this iterable satisfies test.
inherited
arg(dynamic key) → dynamic
Return the value of the first arg of the requested node
args(dynamic key) Iterable
Return the argument values of the requested node
cast<R>() Iterable<R>
A view of this iterable as an iterable of R instances.
inherited
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
dashVals(dynamic key) Iterable
Return the first argument value of each node named '-' that is a child of the requested node
elementAt(int index) KdlNode
Returns the indexth element.
inherited
every(bool test(KdlNode element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(KdlNode element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere(bool test(KdlNode element), {KdlNode orElse()?}) KdlNode
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, KdlNode element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<KdlNode> other) Iterable<KdlNode>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(KdlNode element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(KdlNode element), {KdlNode orElse()?}) KdlNode
The last element that satisfies the given predicate test.
inherited
map<T>(T toElement(KdlNode e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reduce(KdlNode combine(KdlNode value, KdlNode element)) KdlNode
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
singleWhere(bool test(KdlNode element), {KdlNode orElse()?}) KdlNode
The single element that satisfies test.
inherited
skip(int count) Iterable<KdlNode>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(KdlNode element)) Iterable<KdlNode>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
take(int count) Iterable<KdlNode>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(KdlNode element)) Iterable<KdlNode>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toList({bool growable = true}) List<KdlNode>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<KdlNode>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
A string representation of this object.
override
where(bool test(KdlNode element)) Iterable<KdlNode>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<R>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](dynamic key) KdlNode
Request a node. If key is an int, return the node by index. If the key is a String, return the first node with that name

Static Methods

parse(String string, {int? version, Map<String, KdlTypeParser<KdlValue>> valueTypes = const {}, Map<String, KdlTypeParser<KdlNode>> nodeTypes = const {}, bool parseTypes = true}) KdlDocument
Parse a KDL document