Class YamlFormatter
- Namespace
- Cuemon.Text.Yaml.Formatters
- Assembly
- Cuemon.Core.dll
Serializes and deserializes an object, in YAML format.
[Obsolete("All YAML marshalling has been moved to its own assembly; Cuemon.Extensions.YamlDotNet. This member will be removed with next major version.")]
public class YamlFormatter : StreamFormatter<YamlFormatterOptions>, IConfigurable<YamlFormatterOptions>
- Inheritance
-
ObjectFormatter<Stream>YamlFormatter
- Implements
- Inherited Members
Constructors
YamlFormatter()
Initializes a new instance of the YamlFormatter class.
public YamlFormatter()
YamlFormatter(YamlFormatterOptions)
Initializes a new instance of the YamlFormatter class.
public YamlFormatter(YamlFormatterOptions options)
Parameters
options
YamlFormatterOptionsThe configured YamlFormatterOptions.
YamlFormatter(Action<YamlFormatterOptions>)
Initializes a new instance of the YamlFormatter class.
public YamlFormatter(Action<YamlFormatterOptions> setup)
Parameters
setup
Action<YamlFormatterOptions>The YamlFormatterOptions which need to be configured.
Methods
Deserialize(Stream, Type)
Deserializes the specified value
into an object of objectType
.
public override object Deserialize(Stream value, Type objectType)
Parameters
value
StreamThe object from which to deserialize the object graph.
objectType
TypeThe type of the deserialized object.
Returns
- Object
An object of
objectType
.
Exceptions
- System.ArgumentNullException
value
is null -or-objectType
is null.
Serialize(Object, Type)
Serializes the specified source
to an object of System.IO.Stream.
public override Stream Serialize(object source, Type objectType)
Parameters
source
ObjectThe object to serialize to YAML format.
objectType
TypeThe type of the object to serialize.
Returns
- Stream
A stream of the serialized
source
.
Exceptions
- System.ArgumentNullException
source
is null -or-objectType
is null.
See Also
Formatter<TFormat>