Table of Contents

Class JsonDataProvider

Namespace
combit.Reporting.DataProviders
Assembly
combit.ListLabel31.CrossPlatform.dll

Provider for JSON data streams.

[Serializable]
public class JsonDataProvider : IDataProvider, ISerializable, ISupportsLogger
Inheritance
JsonDataProvider
Implements
Derived
Inherited Members

Remarks

This class implements IDataProvider, ISerializable, combit.Reporting.DataProviders.ISupportsParameters, and ISupportsLogger. It can be initialized from a JSON string, a TextReader, or a file path/URL along with provider options.

Constructors

JsonDataProvider(TextReader)

Initializes a new instance of the JsonDataProvider class using a TextReader.

public JsonDataProvider(TextReader reader)

Parameters

reader TextReader

A TextReader to read JSON data from.

JsonDataProvider(SerializationInfo, StreamingContext)

Initializes a new instance of the JsonDataProvider class from serialized data.

protected JsonDataProvider(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo to populate with data.

context StreamingContext

The destination for this serialization.

JsonDataProvider(string)

Initializes a new instance of the JsonDataProvider class using a JSON string.

public JsonDataProvider(string json)

Parameters

json string

A JSON string representing the data.

JsonDataProvider(string, JsonDataProviderOptions)

Initializes a new instance of the JsonDataProvider class using a file path or URL and provider options.

public JsonDataProvider(string filePathOrUrl, JsonDataProviderOptions options)

Parameters

filePathOrUrl string

The file path or URL to load the JSON data from.

options JsonDataProviderOptions

The options to configure the JSON data provider.

Properties

AliasDictionary

A dictionary mapping table names to their original (un-prefixed) names.

protected Dictionary<string, string> AliasDictionary { get; }

Property Value

Dictionary<string, string>

ArrayValueName

Gets or sets the name used for array values.

public string ArrayValueName { get; set; }

Property Value

string

Data

Gets the JSON data object.

protected JsonData Data { get; }

Property Value

JsonData

FileLocation

Gets or sets the file location from which JSON data is read.

protected string FileLocation { get; set; }

Property Value

string

FlattenStructure

Gets or sets a value indicating whether the JSON structure should be flattened.

public bool FlattenStructure { get; set; }

Property Value

bool

Logger

Gets the logger associated with this provider. If no logger is set, a default debug logger is returned.

protected ILlLogger Logger { get; }

Property Value

ILlLogger

NamespacePrefix

Gets or sets an optional prefix to all table names. This allows multiple JsonDataProvider instances with default settings to be included in a DataProviderCollection.

public string NamespacePrefix { get; set; }

Property Value

string

Options

Gets the provider options.

protected JsonDataProviderOptions Options { get; }

Property Value

JsonDataProviderOptions

RelationList

Gets the list of table relations parsed from the JSON data.

protected List<ITableRelation> RelationList { get; }

Property Value

List<ITableRelation>

RootTableName

Gets or sets the root table name.

public string RootTableName { get; set; }

Property Value

string

TableList

Gets the list of tables parsed from the JSON data.

protected List<ITable> TableList { get; }

Property Value

List<ITable>

Methods

GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo with the data needed to serialize the target object.

public void GetObjectData(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo

The SerializationInfo to populate with data.

context StreamingContext

The destination for this serialization.

SetLogger(ILlLogger, bool)

Allows overriding the default debug logger.

public void SetLogger(ILlLogger logger, bool overrideExisting)

Parameters

logger ILlLogger

The logger to use.

overrideExisting bool

If set to true, the new logger will always be used; otherwise, it will only be used if no other logger exists.