C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.JsonConverters.DerivedResourceCreationConverter< T > Class Template Reference

Allows serializing and deserializing derived Analyze Re Resources to a target base type. (For instance deserializing a CatXL object to a base Layer object reference). More...

Public Member Functions

override bool CanConvert (Type objectType)
 Determines if this converter is designed for deserialization to objects of the specified type.
 
override object ReadJson (JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 Parses the json to the specified type.
 
override void WriteJson (JsonWriter writer, object value, JsonSerializer serializer)
 Serializes to the specified type.
 

Static Public Member Functions

static JsonReader CopyReaderForObject (JsonReader reader, JObject jObject)
 Creates a new reader for the specified jObject by copying the settings from an existing reader.
 

Protected Member Functions

override T Create (Type objectType, JObject jObject)
 Create a new instance of the requested resource type for deserialization of a JSON string.
 

Detailed Description

Allows serializing and deserializing derived Analyze Re Resources to a target base type. (For instance deserializing a CatXL object to a base Layer object reference).

Template Parameters
TThe base for which we wish to support deserialization of derived types to.
Type Constraints
T :IAPIType 

Definition at line 16 of file DerivedResourceCreationConverter.cs.

Inheritance diagram for AnalyzeRe.JsonConverters.DerivedResourceCreationConverter< T >:
AnalyzeRe.JsonConverters.JsonCreationConverter< T >

Member Function Documentation

◆ CanConvert()

override bool AnalyzeRe.JsonConverters.JsonCreationConverter< T >.CanConvert ( Type  objectType)
inlineinherited

Determines if this converter is designed for deserialization to objects of the specified type.

Parameters
objectTypeThe target type for deserialization.
Returns
True if the type is supported.

Definition at line 21 of file JsonCreationConverter[T].cs.

◆ CopyReaderForObject()

static JsonReader AnalyzeRe.JsonConverters.JsonCreationConverter< T >.CopyReaderForObject ( JsonReader  reader,
JObject  jObject 
)
inlinestaticinherited

Creates a new reader for the specified jObject by copying the settings from an existing reader.

Parameters
readerThe reader whose settings should be copied.
jObjectThe jObject to create a new reader for.
Returns
The new disposable reader.

Definition at line 14 of file JsonCreationConverter.cs.

◆ Create()

override T AnalyzeRe.JsonConverters.DerivedResourceCreationConverter< T >.Create ( Type  objectType,
JObject  jObject 
)
inlineprotected

Create a new instance of the requested resource type for deserialization of a JSON string.

Parameters
objectTypeThe requested type to convert the JObject to (can be a base type or interface).
jObjectThe JSON object to be converted to the specified class type.
Returns
A new instance of the type specified by the objectType, or a type that derives from the objectType if the JObject refers to a specific sub-type.

Definition at line 33 of file DerivedResourceCreationConverter.cs.

◆ ReadJson()

override object AnalyzeRe.JsonConverters.JsonCreationConverter< T >.ReadJson ( JsonReader  reader,
Type  objectType,
object  existingValue,
JsonSerializer  serializer 
)
inlineinherited

Parses the json to the specified type.

Parameters
readerNewtonsoft.Json.JsonReader
objectTypeTarget type.
existingValueIgnored
serializerNewtonsoft.Json.JsonSerializer to use.
Returns
Deserialized Object

Definition at line 34 of file JsonCreationConverter[T].cs.

◆ WriteJson()

override void AnalyzeRe.JsonConverters.JsonCreationConverter< T >.WriteJson ( JsonWriter  writer,
object  value,
JsonSerializer  serializer 
)
inlineinherited

Serializes to the specified type.

Parameters
writerNewtonsoft.Json.JsonWriter
valueThe object to serialize.
serializerThe Newtonsoft.Json.JsonSerializer to use.

Definition at line 65 of file JsonCreationConverter[T].cs.


The documentation for this class was generated from the following file: