C# 클래스 EdjCase.JsonRpc.Core.JsonConverters.RpcIdJsonConverter

Converter to convert and enforce the id to be a string, number or null
상속: Newtonsoft.Json.JsonConverter
파일 보기 프로젝트 열기: edjCase/JsonRpc

공개 메소드들

메소드 설명
CanConvert ( Type objectType ) : bool

Determines if the type can be convertered with this converter

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

Read the json format and return the correct object type/value for it

WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void

Writes the value of the id to json format

비공개 메소드들

메소드 설명
IsNumericType ( Type type ) : bool

Determines if the type is a number

ValidateValue ( object value ) : object

Validates that the value is a string, number or null and converts emtpy strings to null

메소드 상세

CanConvert() 공개 메소드

Determines if the type can be convertered with this converter
public CanConvert ( Type objectType ) : bool
objectType System.Type Type of the object
리턴 bool

ReadJson() 공개 메소드

Read the json format and return the correct object type/value for it
public ReadJson ( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) : object
reader Newtonsoft.Json.JsonReader Json reader
objectType System.Type Type of property being set
existingValue object The current value of the property being set
serializer Newtonsoft.Json.JsonSerializer Json serializer
리턴 object

WriteJson() 공개 메소드

Writes the value of the id to json format
public WriteJson ( JsonWriter writer, object value, JsonSerializer serializer ) : void
writer Newtonsoft.Json.JsonWriter Json writer
value object Value to be converted to json format
serializer Newtonsoft.Json.JsonSerializer Json serializer
리턴 void