Class JsonFormatter
Serializes and deserializes an object, in JSON format.
Namespace: Cuemon.Serialization.Json.Formatters
Assembly: Cuemon.Serialization.Json.dll
Syntax
public class JsonFormatter : Formatter<Stream>
Constructors
| Improve this DocJsonFormatter()
Initializes a new instance of the JsonFormatter class.
Declaration
public JsonFormatter()
JsonFormatter(Action<JsonFormatterOptions>)
Initializes a new instance of the JsonFormatter class.
Declaration
public JsonFormatter(Action<JsonFormatterOptions> setup)
Parameters
Type | Name | Description |
---|---|---|
Action<JsonFormatterOptions> | setup | The JsonFormatterOptions which need to be configured. |
JsonFormatter(JsonFormatterOptions)
Initializes a new instance of the JsonFormatter class.
Declaration
public JsonFormatter(JsonFormatterOptions options)
Parameters
Type | Name | Description |
---|---|---|
JsonFormatterOptions | options | The configured JsonFormatterOptions. |
Properties
| Improve this DocOptions
Gets the configured options of this JsonFormatter.
Declaration
protected JsonFormatterOptions Options { get; }
Property Value
Type | Description |
---|---|
JsonFormatterOptions | The configured options of this JsonFormatter. |
Methods
| Improve this DocDeserialize(Stream, Type)
Deserializes the specified value
into an object of objectType
.
Declaration
public override object Deserialize(Stream value, Type objectType)
Parameters
Type | Name | Description |
---|---|---|
Stream | value | The string from which to deserialize the object graph. |
Type | objectType | The type of the deserialized object. |
Returns
Type | Description |
---|---|
System.Object | An object of |
Serialize(Object, Type)
Serializes the specified source
to an object of
Declaration
public override Stream Serialize(object source, Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | The object to serialize to JSON format. |
Type | objectType | The type of the object to serialize. |
Returns
Type | Description |
---|---|
Stream | A string of the serialized |
See Also
Formatter<TFormat>