Class DefaultJsonSerializerSettingsProvider
A default JSON serializer settings provider.
Inherited Members
Namespace: Kephas.Serialization.Json
Assembly: Kephas.Serialization.Json.dll
Syntax
public class DefaultJsonSerializerSettingsProvider : Loggable, ILoggable, IJsonSerializerSettingsProvider
Constructors
| Improve this Doc View SourceDefaultJsonSerializerSettingsProvider(ITypeResolver, ILogManager, ICollection<IJsonConverter>)
Initializes a new instance of the DefaultJsonSerializerSettingsProvider class.
Declaration
public DefaultJsonSerializerSettingsProvider(ITypeResolver typeResolver, ILogManager logManager, ICollection<IJsonConverter> jsonConverters = null)
Parameters
Type | Name | Description |
---|---|---|
ITypeResolver | typeResolver | The type resolver. |
ILogManager | logManager | Manager for log. |
System.Collections.Generic.ICollection<IJsonConverter> | jsonConverters | Optional. The JSON converters (optional). |
Properties
| Improve this Doc View SourceInstance
Gets the default instance of this settings provider.
Declaration
public static DefaultJsonSerializerSettingsProvider Instance { get; }
Property Value
Type | Description |
---|---|
DefaultJsonSerializerSettingsProvider | The instance. |
TypeResolver
Gets the type resolver.
Declaration
public ITypeResolver TypeResolver { get; }
Property Value
Type | Description |
---|---|
ITypeResolver | The type resolver. |
Methods
| Improve this Doc View SourceGetContractResolver(Boolean)
Gets the contract resolver.
Declaration
protected virtual IContractResolver GetContractResolver(bool camelCase)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | camelCase | If set to |
Returns
Type | Description |
---|---|
Newtonsoft.Json.Serialization.IContractResolver | The contract resolver. |
GetJsonSerializerSettings()
Gets the JSON serializer settings.
Declaration
public JsonSerializerSettings GetJsonSerializerSettings()
Returns
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings | The JSON serializer settings. |
GetJsonSerializerSettings(Boolean, Boolean, IEnumerable<JsonConverter>)
Gets the json serializer settings.
Declaration
protected virtual JsonSerializerSettings GetJsonSerializerSettings(bool camelCase, bool thrownOnMissingMembers = true, IEnumerable<JsonConverter> converters = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | camelCase | If set to |
System.Boolean | thrownOnMissingMembers | If set to |
System.Collections.Generic.IEnumerable<Newtonsoft.Json.JsonConverter> | converters | The json converters. |
Returns
Type | Description |
---|---|
Newtonsoft.Json.JsonSerializerSettings | The json serializer settings. |
GetSerializationBinder()
Gets the serialization binder.
Declaration
protected virtual ISerializationBinder GetSerializationBinder()
Returns
Type | Description |
---|---|
Newtonsoft.Json.Serialization.ISerializationBinder | The serialization binder. |
HandleJsonSerializationError(Object, ErrorEventArgs)
Error handler for json deserialization errors.
Declaration
protected virtual void HandleJsonSerializationError(object sender, ErrorEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender. |
Newtonsoft.Json.Serialization.ErrorEventArgs | args | The Newtonsoft.Json.Serialization.ErrorEventArgs instance containing the event data. |