Class JsonConverter
Converts an object to and from JSON.
Inheritance
Inherited Members
Namespace: Bayat.Json
Assembly: Bayat.Json.Runtime.dll
Syntax
public abstract class JsonConverter
Properties
| Improve this Doc View SourceCanRead
Gets a value indicating whether this JsonConverter can read JSON.
Declaration
public virtual bool CanRead { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
CanWrite
Gets a value indicating whether this JsonConverter can write JSON.
Declaration
public virtual bool CanWrite { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsGenericConverter
Gets a value indicating whether this JsonConverter is a generic converter for the object type such as a base class type.
Declaration
public virtual bool IsGenericConverter { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceCanConvert(Type)
Determines whether this instance can convert the specified object type.
Declaration
public abstract bool CanConvert(Type objectType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | objectType | Type of the object. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ReadJson(JsonReader, Type, Object, JsonSerializerReader)
Reads the JSON representation of the object.
Declaration
public abstract object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializerReader internalReader)
Parameters
Type | Name | Description |
---|---|---|
JsonReader | reader | The JsonReader to read from. |
System.Type | objectType | Type of the object. |
System.Object | existingValue | The existing value of object being read. |
JsonSerializerReader | internalReader | The calling serializer internal reader. |
Returns
Type | Description |
---|---|
System.Object | The object value. |
WriteJson(JsonWriter, Object, JsonSerializerWriter)
Writes the JSON representation of the object.
Declaration
public abstract void WriteJson(JsonWriter writer, object value, JsonSerializerWriter internalWriter)
Parameters
Type | Name | Description |
---|---|---|
JsonWriter | writer | The JsonWriter to write to. |
System.Object | value | The value. |
JsonSerializerWriter | internalWriter | The calling serializer internal writer. |