Show / Hide Table of Contents

Class JSONSerializer

Serializer fo reading/writing objects to CSV files.

Inheritance
object
JSONSerializer
Implements
ISerializer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Serialization
Assembly: WMServer.dll
Syntax
public class JSONSerializer : ISerializer

Constructors

JSONSerializer(string?)

Create a new instance of a JSONSerializer and optionally set the filename.

Declaration
public JSONSerializer(string? connection = null)
Parameters
Type Name Description
string connection

The file name (relative or absolute) from/to which data will be read/written

Properties

Connection

JSON file name to read from / write to.

Declaration
public string? Connection { get; set; }
Property Value
Type Description
string

DataSource

No internal persistent data source is used. Returns a reference to this object.

Declaration
public object DataSource { get; }
Property Value
Type Description
object

Methods

Close()

Does nothing. JSON read/write operations are atomic so Open() and Close() are not required.

Declaration
public void Close()
Exceptions
Type Condition
NotImplementedException

DeserializeObjects<T>(Func<T, bool>)

Deserialzes an object, or collection of objects. If the filter condition is supplied, only the objects where the filter condition is true are returned.

Declaration
public List<T> DeserializeObjects<T>(Func<T, bool> filter)
Parameters
Type Name Description
Func<T, bool> filter
Returns
Type Description
List<T>
Type Parameters
Name Description
T
Exceptions
Type Condition
NotImplementedException

Open()

Does nothing. JSON read/write operations are atomic so Open() and Close() are not required.

Declaration
public void Open()
Exceptions
Type Condition
NotImplementedException

SerializeObject(object, SerializationParams?)

Serialize the specified oject in JSON format, and write them to the location specified in the Connection property.

Declaration
public void SerializeObject(object srzObj, SerializationParams? srzParams = null)
Parameters
Type Name Description
object srzObj
SerializationParams srzParams

SerializeObjects(IEnumerable<object>, SerializationParams?)

Serialize the specified collection of ojects to CSV format, and write them to the location specified in the Connection property.

Declaration
public void SerializeObjects(IEnumerable<object> srzObjs, SerializationParams? srzParams = null)
Parameters
Type Name Description
IEnumerable<object> srzObjs
SerializationParams srzParams

Implements

ISerializer
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE