Provides input data for PivotData from JSON stream.
Inheritance Hierarchy
NReco.PivotData.InputJsonSource
Namespace: NReco.PivotData.Input
Assembly: NReco.PivotData.Extensions (in NReco.PivotData.Extensions.dll) Version: 1.6.1
Syntax
The JsonSource type exposes the following members.
Constructors
Name | Description | |
---|---|---|
JsonSource |
Initializes new JsonSource instance with specified TextReader.
|
Properties
Name | Description | |
---|---|---|
Headers |
Get or set explicit list of headers for JSON array values.
| |
RowsLimit |
Get or set a limit for maximum number of CSV rows to read.
|
Methods
Name | Description | |
---|---|---|
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetHashCode | (Inherited from Object.) | |
GetJsonReaderEnum | ||
GetType | (Inherited from Object.) | |
GetValue | ||
MemberwiseClone | (Inherited from Object.) | |
ReadData |
Reads data from CSV reader and provides it as IEnumerable with field access handler to the specified callback.
| |
ToString | (Inherited from Object.) |
Remarks
Examples
var inputJson = "[ [2015, true, 250 ], [2016, false, 100], [2016, true, 68] ]"; var jsonSource = new JsonSource( new StringReader(inputJson) ) { Headers = new[] { "year", "active", "value" } }; var pvtData = new PivotData(new[]{"year","active"}, new SumAggregatorFactory("value") ); pvtData.ProcessData(jsonSource);
Examples
var inputJson = "[ {"year": 2015, "active": true, "value": 250 }, {"year": 2016, "active": false, "value": 100 }, {"year": 2016, "active": true, "value": 68} ]"; var jsonSource = new JsonSource( new StringReader(inputJson) ); var pvtData = new PivotData(new[]{"year","active"}, new SumAggregatorFactory("value") ); pvtData.ProcessData(jsonSource);
See Also