Show / Hide Table of Contents

Class JSONReader

Provides deserialization functionality from JSON format

Inheritance
System.Object
JSONReader
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.Serialization.JSON
Assembly: NFX.dll
Syntax
public static class JSONReader

Methods

DeserializeDataObject(ISourceText, Boolean)

Declaration
public static IJSONDataObject DeserializeDataObject(ISourceText source, bool caseSensitiveMaps = true)
Parameters
Type Name Description
ISourceText source
System.Boolean caseSensitiveMaps
Returns
Type Description
IJSONDataObject

DeserializeDataObject(Stream, Encoding, Boolean)

Declaration
public static IJSONDataObject DeserializeDataObject(Stream stream, Encoding encoding = null, bool caseSensitiveMaps = true)
Parameters
Type Name Description
System.IO.Stream stream
System.Text.Encoding encoding
System.Boolean caseSensitiveMaps
Returns
Type Description
IJSONDataObject

DeserializeDataObject(String, Boolean)

Declaration
public static IJSONDataObject DeserializeDataObject(string source, bool caseSensitiveMaps = true)
Parameters
Type Name Description
System.String source
System.Boolean caseSensitiveMaps
Returns
Type Description
IJSONDataObject

DeserializeDataObjectFromFile(String, Encoding, Boolean)

Declaration
public static IJSONDataObject DeserializeDataObjectFromFile(string filePath, Encoding encoding = null, bool caseSensitiveMaps = true)
Parameters
Type Name Description
System.String filePath
System.Text.Encoding encoding
System.Boolean caseSensitiveMaps
Returns
Type Description
IJSONDataObject

DeserializeDynamic(ISourceText, Boolean)

Declaration
public static dynamic DeserializeDynamic(ISourceText source, bool caseSensitiveMaps = true)
Parameters
Type Name Description
ISourceText source
System.Boolean caseSensitiveMaps
Returns
Type Description
System.Object

DeserializeDynamic(Stream, Encoding, Boolean)

Declaration
public static dynamic DeserializeDynamic(Stream stream, Encoding encoding = null, bool caseSensitiveMaps = true)
Parameters
Type Name Description
System.IO.Stream stream
System.Text.Encoding encoding
System.Boolean caseSensitiveMaps
Returns
Type Description
System.Object

DeserializeDynamic(String, Boolean)

Declaration
public static dynamic DeserializeDynamic(string source, bool caseSensitiveMaps = true)
Parameters
Type Name Description
System.String source
System.Boolean caseSensitiveMaps
Returns
Type Description
System.Object

ToRow(Row, JSONDataMap, Boolean, Nullable<JSONReader.NameBinding>)

Converts JSONMap into supplied row instance. The extra data found in JSON map will be placed in AmorphousData dictionary if the row implemets IAmorphousData, discarded otherwise. Note: This method provides "the best match" and does not guarantee that all data will/can be converted from JSON, i.e. it can only convert one dimensional arrays and Lists of either primitive or TypeRow-derived entries

Declaration
public static void ToRow(Row row, JSONDataMap jsonMap, bool fromUI = true, JSONReader.NameBinding? nameBinding = default (JSONReader.NameBinding? ))
Parameters
Type Name Description
Row row

Row instance to convert into

JSONDataMap jsonMap

JSON data to convert into row

System.Boolean fromUI

When true indicates that data came from UI, hence NonUI-marked fields should be skipped. True by default

System.Nullable<JSONReader.NameBinding> nameBinding

Used for backend name matching or null (any target)

ToRow(Type, JSONDataMap, Boolean, Nullable<JSONReader.NameBinding>)

Converts JSONMap into typed row of the requested type. The requested type must be derived from NFX.DataAccess.CRUD.TypedRow. The extra data found in JSON map will be placed in AmorphousData dictionary if the row implemets IAmorphousData, discarded otherwise. Note: This method provides "the best match" and does not guarantee that all data will/can be converted from JSON, i.e. it can only convert one dimensional arrays and Lists of either primitive or TypeRow-derived entries

Declaration
public static TypedRow ToRow(Type type, JSONDataMap jsonMap, bool fromUI = true, JSONReader.NameBinding? nameBinding = default (JSONReader.NameBinding? ))
Parameters
Type Name Description
System.Type type

TypedRow subtype to convert into

JSONDataMap jsonMap

JSON data to convert into row

System.Boolean fromUI

When true indicates that data came from UI, hence NonUI-marked fields should be skipped. True by default

System.Nullable<JSONReader.NameBinding> nameBinding

Used for backend name matching or null (any target)

Returns
Type Description
TypedRow

ToRow<T>(JSONDataMap, Boolean, Nullable<JSONReader.NameBinding>)

Generic version of ToRow(Type, JSONDataMap, bool)/>

Declaration
public static T ToRow<T>(JSONDataMap jsonMap, bool fromUI = true, JSONReader.NameBinding? nameBinding = default (JSONReader.NameBinding? ))where T : TypedRow
Parameters
Type Name Description
JSONDataMap jsonMap
System.Boolean fromUI
System.Nullable<JSONReader.NameBinding> nameBinding
Returns
Type Description
T
Type Parameters
Name Description
T

TypedRow

ToRowset(JSONDataMap, Boolean, Boolean)

Deserializes into Rowset or Table from JSONDataMap, as serialized by RowsedBase.WriteAsJSON()

Declaration
public static RowsetBase ToRowset(JSONDataMap jsonMap, bool schemaOnly = false, bool readOnlySchema = false)
Parameters
Type Name Description
JSONDataMap jsonMap
System.Boolean schemaOnly
System.Boolean readOnlySchema
Returns
Type Description
RowsetBase

ToRowset(String, Boolean, Boolean)

Deserializes into Rowset or Table from JSOnDataMap, as serialized by RowsedBase.WriteAsJSON()

Declaration
public static RowsetBase ToRowset(string json, bool schemaOnly = false, bool readOnlySchema = false)
Parameters
Type Name Description
System.String json
System.Boolean schemaOnly
System.Boolean readOnlySchema
Returns
Type Description
RowsetBase
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX