C# Class Newtonsoft.Json.Serialization.DefaultContractResolver

Inheritance: IContractResolver
Show file Open project: thirumg/Avro.NET Class Usage Examples

Public Methods

Method Description
DefaultContractResolver ( ) : System

Initializes a new instance of the DefaultContractResolver class.

ResolveContract ( Type type ) : JsonContract

Resolves the contract for a given type.

Protected Methods

Method Description
CreateArrayContract ( Type objectType ) : JsonArrayContract

Creates a JsonArrayContract for the given type.

CreateDictionaryContract ( Type objectType ) : JsonDictionaryContract

Creates a JsonDictionaryContract for the given type.

CreateLinqContract ( Type objectType ) : JsonLinqContract

Creates a JsonLinqContract for the given type.

CreateMemberValueProvider ( MemberInfo member ) : IValueProvider

Creates the IValueProvider used by the serializer to get and set values from a member.

CreateObjectContract ( Type objectType ) : JsonObjectContract

Creates a JsonObjectContract for the given type.

CreatePrimitiveContract ( Type objectType ) : Newtonsoft.Json.Serialization.JsonPrimitiveContract

Creates a JsonPrimitiveContract for the given type.

CreateProperties ( JsonObjectContract contract ) : IList

Creates properties for the given JsonObjectContract.

CreateProperty ( JsonObjectContract contract, MemberInfo member ) : JsonProperty

Creates a JsonProperty for the given MemberInfo.

GetSerializableMembers ( Type objectType ) : List

Gets the serializable members for the type.

ResolveContractConverter ( Type objectType ) : JsonConverter

Resolves the default JsonConverter for the contract.

ResolvePropertyName ( string propertyName ) : string

Resolves the name of the property.

Private Methods

Method Description
CreateContract ( Type objectType ) : JsonContract
GetClrTypeFullName ( Type type ) : string
GetParametrizedConstructor ( Type objectType ) : ConstructorInfo
InitializeContract ( JsonContract contract ) : void
IsValidCallback ( MethodInfo method, ParameterInfo parameters, Type attributeType, MethodInfo currentCallback, Type &prevAttributeType ) : bool
ShouldSerializeEntityMember ( MemberInfo memberInfo ) : bool

Method Details

CreateArrayContract() protected method

Creates a JsonArrayContract for the given type.
protected CreateArrayContract ( Type objectType ) : JsonArrayContract
objectType System.Type Type of the object.
return JsonArrayContract

CreateDictionaryContract() protected method

Creates a JsonDictionaryContract for the given type.
protected CreateDictionaryContract ( Type objectType ) : JsonDictionaryContract
objectType System.Type Type of the object.
return JsonDictionaryContract

CreateLinqContract() protected method

Creates a JsonLinqContract for the given type.
protected CreateLinqContract ( Type objectType ) : JsonLinqContract
objectType System.Type Type of the object.
return JsonLinqContract

CreateMemberValueProvider() protected method

Creates the IValueProvider used by the serializer to get and set values from a member.
protected CreateMemberValueProvider ( MemberInfo member ) : IValueProvider
member System.Reflection.MemberInfo The member.
return IValueProvider

CreateObjectContract() protected method

Creates a JsonObjectContract for the given type.
protected CreateObjectContract ( Type objectType ) : JsonObjectContract
objectType System.Type Type of the object.
return JsonObjectContract

CreatePrimitiveContract() protected method

Creates a JsonPrimitiveContract for the given type.
protected CreatePrimitiveContract ( Type objectType ) : Newtonsoft.Json.Serialization.JsonPrimitiveContract
objectType System.Type Type of the object.
return Newtonsoft.Json.Serialization.JsonPrimitiveContract

CreateProperties() protected method

Creates properties for the given JsonObjectContract.
protected CreateProperties ( JsonObjectContract contract ) : IList
contract JsonObjectContract The contract to create properties for.
return IList

CreateProperty() protected method

Creates a JsonProperty for the given MemberInfo.
protected CreateProperty ( JsonObjectContract contract, MemberInfo member ) : JsonProperty
contract JsonObjectContract The member's declaring types .
member System.Reflection.MemberInfo The member to create a for.
return JsonProperty

DefaultContractResolver() public method

Initializes a new instance of the DefaultContractResolver class.
public DefaultContractResolver ( ) : System
return System

GetSerializableMembers() protected method

Gets the serializable members for the type.
protected GetSerializableMembers ( Type objectType ) : List
objectType System.Type The type to get serializable members for.
return List

ResolveContract() public method

Resolves the contract for a given type.
public ResolveContract ( Type type ) : JsonContract
type System.Type The type to resolve a contract for.
return JsonContract

ResolveContractConverter() protected method

Resolves the default JsonConverter for the contract.
protected ResolveContractConverter ( Type objectType ) : JsonConverter
objectType System.Type Type of the object.
return Newtonsoft.Json.JsonConverter

ResolvePropertyName() protected method

Resolves the name of the property.
protected ResolvePropertyName ( string propertyName ) : string
propertyName string Name of the property.
return string