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
readerTextReaderA 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
infoSerializationInfoThe SerializationInfo to populate with data.
contextStreamingContextThe destination for this serialization.
JsonDataProvider(string)
Initializes a new instance of the JsonDataProvider class using a JSON string.
public JsonDataProvider(string json)
Parameters
jsonstringA 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
filePathOrUrlstringThe file path or URL to load the JSON data from.
optionsJsonDataProviderOptionsThe 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
ArrayValueName
Gets or sets the name used for array values.
public string ArrayValueName { get; set; }
Property Value
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
FlattenStructure
Gets or sets a value indicating whether the JSON structure should be flattened.
public bool FlattenStructure { get; set; }
Property Value
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
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
Options
Gets the provider options.
protected JsonDataProviderOptions Options { get; }
Property Value
RelationList
Gets the list of table relations parsed from the JSON data.
protected List<ITableRelation> RelationList { get; }
Property Value
RootTableName
Gets or sets the root table name.
public string RootTableName { get; set; }
Property Value
TableList
Gets the list of tables parsed from the JSON data.
protected List<ITable> TableList { get; }
Property Value
Methods
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe SerializationInfo to populate with data.
contextStreamingContextThe destination for this serialization.
SetLogger(ILlLogger, bool)
Allows overriding the default debug logger.
public void SetLogger(ILlLogger logger, bool overrideExisting)