Class Formatter<TFormat>
An abstract class that supports serialization and deserialization of an object, in a given format.
Namespace: Cuemon.Serialization.Formatters
Assembly: Cuemon.Serialization.dll
Syntax
public abstract class Formatter<TFormat>
Type Parameters
Name | Description |
---|---|
TFormat | The type of format which serialization and deserialization is invoked. |
Constructors
| Improve this DocFormatter()
Initializes a new instance of the Formatter<TFormat> class.
Declaration
protected Formatter()
Methods
| Improve this DocDeserialize(TFormat, Type)
Deserializes the specified value
of TFormat
into an object of objectType
.
Declaration
public abstract object Deserialize(TFormat value, Type objectType)
Parameters
Type | Name | Description |
---|---|---|
TFormat | value | The object from which to deserialize the object graph. |
System.Type | objectType | The type of the deserialized object. |
Returns
Type | Description |
---|---|
System.Object | An object of |
Deserialize<T>(TFormat)
Deserializes the specified value
of TFormat
into an object of T
.
Declaration
public T Deserialize<T>(TFormat value)
Parameters
Type | Name | Description |
---|---|---|
TFormat | value | The object from which to deserialize the object graph. |
Returns
Type | Description |
---|---|
T | An object of |
Type Parameters
Name | Description |
---|---|
T | The type of the object to return. |
Serialize(Object)
Serializes the specified source
to an object of TFormat
.
Declaration
public TFormat Serialize(object source)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | The object to serialize to a given format. |
Returns
Type | Description |
---|---|
TFormat | An object of the serialized |
Serialize(Object, Type)
Serializes the object of this instance to an object of TFormat
.
Declaration
public abstract TFormat Serialize(object source, Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | source | The object to serialize to a given format. |
System.Type | objectType | The type of the object to serialize. |
Returns
Type | Description |
---|---|
TFormat | An object of the serialized |