C# Class LtiLibrary.Core.Common.JsonLdObjectConverter

Serialize a JsonLdObject to JSON representation.
Collects JsonLdObject Terms and writes them first as @context. Does not convert JSON to a JsonLdObject.
Inheritance: Newtonsoft.Json.JsonConverter
ファイルを表示 Open project: andyfmiller/LtiLibrary

Public Methods

Method Description
CanConvert ( Type objectType ) : bool
ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void

Writes the JSON representation of the object.

Private Methods

Method Description
GetExternalContextId ( IJsonLdObject obj ) : Uri

Get the external context from this object.

GetTerms ( IJsonLdObject obj ) : string>.IDictionary

Collect the terms from the JsonLdObject and all its child properties.

Method Details

CanConvert() public method

public CanConvert ( Type objectType ) : bool
objectType System.Type
return bool

ReadJson() public method

public ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
reader Newtonsoft.Json.JsonReader
objectType System.Type
existingValue object
serializer Newtonsoft.Json.JsonSerializer
return object

WriteJson() public method

Writes the JSON representation of the object.
public WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void
writer Newtonsoft.Json.JsonWriter The Newtonsoft.Json.JsonWriter to write to.
value object The value.
serializer Newtonsoft.Json.JsonSerializer The calling serializer.
return void