YamlNode Class
A node of the document object model: a YamlMapping, a YamlSequence or a YamlValue, like JsonNode in System.Text.Json.
public abstract class YamlNodeRemarks
A YamlStreamDocument holds the root node of a document, and a YamlStream holds documents: they are not nodes. For a read-only document that does not create an object per node, see YamlDocument.
Constructors
| Name | Description |
|---|---|
| YamlNode() |
YamlNode()
protected YamlNode()No documentation is available.
Properties
| Name | Description |
|---|---|
| Anchor | Gets or sets anchor. |
| IsCanonical | Gets is Canonical. |
| Tag | Gets or sets tag. |
Anchor
IsCanonical
Tag
Methods
| Name | Description |
|---|---|
| DeepClone() | Creates a deep clone of the current node. |
| EnumerateEvents() | Enumerates parsing events for this YAML node. |
| FromObject(object, YamlSerializerOptions?, Type?) | Creates a YAML node from an object. |
| ToObject(Type, YamlSerializerOptions?) | Converts this YAML node to an object. |
| ToObject<T>(YamlSerializerOptions?) | Converts this node to an instance of T. |
| ToString() | Returns a string representation of the current instance. |
| WriteTo(IEmitter, bool) | Writes the node as a YAML document. |
| WriteTo(TextWriter, bool) | Writes the node as a YAML document. |
DeepClone()
EnumerateEvents()
YamlNode.csEnumerates parsing events for this YAML node.
public IEnumerable<ParsingEvent> EnumerateEvents()Returns
FromObject(object, YamlSerializerOptions?, Type?)
YamlNode.csCreates a YAML node from an object.
public static YamlNode FromObject(object value, YamlSerializerOptions? options = null, Type? expectedType = null)ToObject overloads
ToObject(Type, YamlSerializerOptions?)
YamlNode.csConverts this YAML node to an object.
public object? ToObject(Type type, YamlSerializerOptions? options = null)ToObject<T>(YamlSerializerOptions?)
YamlNode.csConverts this node to an instance of T.
public T? ToObject<T>(YamlSerializerOptions? options = null)ToString()
YamlNode.csWriteTo overloads
WriteTo(IEmitter, bool)
YamlNode.csWriteTo(TextWriter, bool)
YamlNode.csWrites the node as a YAML document.
public void WriteTo(TextWriter writer, bool suppressDocumentTags = false)Parameters
writerTextWritersuppressDocumentTagsbool