Class JsonDataReader
Provides methods for reading data in the Json format.
Implements
Inherited Members
Namespace: Terrasoft.Common
Assembly: Terrasoft.Common.dll
Syntax
public class JsonDataReader : DataReader, IDataReader, IDisposable
Constructors
JsonDataReader()
Declaration
protected JsonDataReader()
JsonDataReader(Stream)
Initializes a new instance of the JsonDataReader class using the specified stream.
Declaration
public JsonDataReader(Stream input)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | input | The stream that contains data in Json format. |
JsonDataReader(TextReader)
Initializes a new instance of the JsonDataReader class using the specified System.IO.TextReader.
Declaration
public JsonDataReader(TextReader input)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | input | System.IO.TextReader, from which the data in Json format should be read. |
Properties
CurrentName
Declaration
public override string CurrentName { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
CurrentValue
Declaration
public override object CurrentValue { get; }
Property Value
Type | Description |
---|---|
System.Object |
Overrides
Methods
Close()
Closes the current JsonDataReader instance.
Declaration
public override void Close()
Overrides
Dispose(Boolean)
Deletes, releases and resets managed and unmanaged resources.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
|
Overrides
GetBoolValue()
Returns the value of the current property of the System.Boolean type.
Declaration
public override bool GetBoolValue()
Returns
Type | Description |
---|---|
System.Boolean | The current value of the property of the System.Boolean type. |
Overrides
GetDateTimeValue()
Returns the value of the current property of the System.DateTime type.
Declaration
public override DateTime GetDateTimeValue()
Returns
Type | Description |
---|---|
System.DateTime | The current value of the property of the System.DateTime type. |
Overrides
GetDeserializedObjectValue(Type)
Declaration
public override object GetDeserializedObjectValue(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | objectType |
Returns
Type | Description |
---|---|
System.Object |
Overrides
GetDoubleValue()
Returns the value of the current property of the System.Double type.
Declaration
public override double GetDoubleValue()
Returns
Type | Description |
---|---|
System.Double | The current value of the property of the System.Double type. |
Overrides
GetEnumValue<TValue>()
Gets the enumeration element that corresponds to the value of the current property.
Declaration
public override TValue GetEnumValue<TValue>()
where TValue : struct
Returns
Type | Description |
---|---|
TValue | The enumeration element that corresponds to the value of the current property. |
Type Parameters
Name | Description |
---|---|
TValue | Any type. |
Overrides
GetGuidValue()
Returns the value of the current property of the System.Guid type.
Declaration
public override Guid GetGuidValue()
Returns
Type | Description |
---|---|
System.Guid | The current value of the property of the System.Guid type. |
Overrides
GetIntValue()
Returns the value of the current property of the System.Int32 type.
Declaration
public override int GetIntValue()
Returns
Type | Description |
---|---|
System.Int32 | The current value of the property of the System.Int32 type. |
Overrides
GetLocalizableStringValue()
Returns the value of the current property of the LocalizableString type.
Declaration
public override LocalizableString GetLocalizableStringValue()
Returns
Type | Description |
---|---|
LocalizableString | The current value of the property of the LocalizableString type. |
Overrides
GetSerialazebleObjectValue(Type)
Gets the value of the current deserialized property converted to the specified type.
Declaration
public override object GetSerialazebleObjectValue(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | objectType | The type of the deserializable property value. |
Returns
Type | Description |
---|---|
System.Object | The value of the deserializable property of the |
Overrides
GetSerializableObjectValue()
Returns the value of the current deserialized property.
Declaration
public override object GetSerializableObjectValue()
Returns
Type | Description |
---|---|
System.Object | The value of the serializable property of the System.Object. |
Overrides
GetSerializableObjectValue<TValue>()
Gets the value of the current deserialized property of this type.
Declaration
public override TValue GetSerializableObjectValue<TValue>()
Returns
Type | Description |
---|---|
TValue | The value of the current deserializable property of the |
Type Parameters
Name | Description |
---|---|
TValue | The type of the deserialized property value. |
Overrides
GetStreamValue()
Returns the value of the current property of the System.IO.Stream type.
Declaration
public override Stream GetStreamValue()
Returns
Type | Description |
---|---|
System.IO.Stream | The current value of the property of the System.IO.Stream type. |
Overrides
GetStreamValue(Stream)
Writes the value of the current property to the specified stream.
Declaration
public override void GetStreamValue(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write to. |
Overrides
GetStringValue()
Returns the value of the current property of the System.String type.
Declaration
public override string GetStringValue()
Returns
Type | Description |
---|---|
System.String | The current value of the property of the System.String type. |
Overrides
GetValue(Type)
Gets the value of the current property converted to the specified type.
Declaration
public override object GetValue(Type valueType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | valueType | Type. |
Returns
Type | Description |
---|---|
System.Object | The value of the current property, converted to the |
Overrides
GetValue(DataConverter)
Gets object that represents the value of the current property, converted with the help of the passed instance DataConverter.
Declaration
public override object GetValue(DataConverter converter)
Parameters
Type | Name | Description |
---|---|---|
DataConverter | converter | The DataConverter instance, used for conversion. |
Returns
Type | Description |
---|---|
System.Object | The value of the current property/attribute of the System.Object type, converted according to the |
Overrides
GetValue<TValue>()
Gets the value of this type of the current property, converting it to this type.
Declaration
public override TValue GetValue<TValue>()
Returns
Type | Description |
---|---|
TValue | The value of the property converted to the specified type. |
Type Parameters
Name | Description |
---|---|
TValue | Any type. |
Overrides
Read()
Moves the current position in the data set to the next property of the current nesting level.
Declaration
public override string Read()
Returns
Type | Description |
---|---|
System.String | The string with the current property name or empty string if the end of the data set has been reached. |
Overrides
ReadInto()
Moves the current position in the data set to one nesting level down.
Declaration
public override string ReadInto()
Returns
Type | Description |
---|---|
System.String | The string with the current property name or empty string if the current level has no attached properties. |
Overrides
ReadNextCollectionItem()
Moves to the next element in the collection of elements.
Declaration
public override bool ReadNextCollectionItem()
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
ReadOut()
Moves the current position in the data set to one nesting level up.
Declaration
public override string ReadOut()
Returns
Type | Description |
---|---|
System.String | The empty string. Call Read() to receive the name of the next property. |