Table of Contents

Class CustomCreationConverter<T>

Namespace
Newtonsoft.Json.Converters
Assembly
Newtonsoft.Json.dll

Create a custom object

public abstract class CustomCreationConverter<T> : JsonConverter

Type Parameters

T
Inheritance
CustomCreationConverter<T>
Inherited Members

Constructors

CustomCreationConverter()

protected CustomCreationConverter()

Properties

CanWrite

Gets a value indicating whether this JsonConverter can write JSON.

public override bool CanWrite { get; }

Property Value

bool

true if this JsonConverter can write JSON; otherwise, false.

Methods

CanConvert(Type)

Determines whether this instance can convert the specified object type.

public override bool CanConvert(Type objectType)

Parameters

objectType Type

Type of the object.

Returns

bool

true if this instance can convert the specified object type; otherwise, false.

Create(Type)

Creates an object which will then be populated by the serializer.

public abstract T Create(Type objectType)

Parameters

objectType Type

Type of the object.

Returns

T

ReadJson(JsonReader, Type, object, JsonSerializer)

Reads the JSON representation of the object.

public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)

Parameters

reader JsonReader

The JsonReader to read from.

objectType Type

Type of the object.

existingValue object

The existing value of object being read.

serializer JsonSerializer

The calling serializer.

Returns

object

The object value.

WriteJson(JsonWriter, object, JsonSerializer)

Writes the JSON representation of the object.

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)

Parameters

writer JsonWriter

The JsonWriter to write to.

value object

The value.

serializer JsonSerializer

The calling serializer.