Table of Contents

Class JsonOptions

Namespace
Alis.Core.Aspect.Data.Json
Assembly
Alis.dll

Define options for JSON.

public class JsonOptions

Inheritance

Inherited Members

Constructors

JsonOptions()

Initializes a new instance of the Alis.Core.Aspect.Data.Json.JsonOptions class.

public JsonOptions()

Fields

DefaultDateTimeStyles

The allow white spaces

internal const DateTimeStyles DefaultDateTimeStyles = AllowWhiteSpaces | AssumeUniversal

Field Value

DateTimeStyles

_exceptions

The exception

private readonly List<Exception> _exceptions

Field Value

List<Exception>

Properties

AfterWriteObjectCallback

Gets or sets a callback that is called before an object (not a value) is serialized.

public JsonCallback AfterWriteObjectCallback { get; internal set; }

Property Value

JsonCallback

ApplyEntryCallback

Gets or sets a callback that is called during deserialization, before a dictionary entry is applied to a target object.

public JsonCallback ApplyEntryCallback { get; private set; }

Property Value

JsonCallback

BeforeWriteObjectCallback

Gets or sets a callback that is called before an object (not a value) is serialized.

public JsonCallback BeforeWriteObjectCallback { get; internal set; }

Property Value

JsonCallback

CreateInstanceCallback

Gets or sets a callback that is called before an instance of an object is created.

public JsonCallback CreateInstanceCallback { get; internal set; }

Property Value

JsonCallback

DateTimeFormat

Gets or sets the date time format.

public string DateTimeFormat { get; set; }

Property Value

string

DateTimeOffsetFormat

Gets or sets the date time offset format.

public string DateTimeOffsetFormat { get; set; }

Property Value

string

DateTimeStyles

Gets or sets the date time styles.

public DateTimeStyles DateTimeStyles { get; set; }

Property Value

DateTimeStyles

Exceptions

Gets the des-relation exceptions. Will be empty if ThrowExceptions is set to false.

public Exception[] Exceptions { get; }

Property Value

Exception[]

FinalObjectGraph

Gets the value of the final object graph

internal IDictionary<object, object> FinalObjectGraph { get; }

Property Value

IDictionary<object, object>

FinalStreamingBufferChunkSize

Gets the value of the final streaming buffer chunk size

internal int FinalStreamingBufferChunkSize { get; }

Property Value

int

FormattingTab

Gets or sets the formatting tab string.

public string FormattingTab { get; set; }

Property Value

string

GetListObjectCallback

Gets or sets a callback that is called during deserialization, to deserialize a list object.

public JsonCallback GetListObjectCallback { get; internal set; }

Property Value

JsonCallback

GuidFormat

Gets or sets the guid format.

public string GuidFormat { get; set; }

Property Value

string

JsonPCallback

Gets or sets the JSONP callback. It will be added as wrapper around the result. Check this article for more: http://en.wikipedia.org/wiki/JSONP

public string JsonPCallback { get; set; }

Property Value

string

MapEntryCallback

Gets or sets a callback that is called during deserialization, before a dictionary entry is mapped to a target object.

public JsonCallback MapEntryCallback { get; internal set; }

Property Value

JsonCallback

MaximumExceptionsCount

Gets or sets the maximum exceptions count.

public int MaximumExceptionsCount { get; set; }

Property Value

int

ObjectGraph

Gets or sets a utility class that will store an object graph to avoid serialization cycles. If null, a Dictionary<object, object> using an object reference comparer will be used.

internal IDictionary<object, object> ObjectGraph { get; set; }

Property Value

IDictionary<object, object>

SerializationLevel

Gets a value indicating the current serialization level.

public int SerializationLevel { get; internal set; }

Property Value

int

SerializationOptions

Gets or sets the serialization options.

public JsonSerializationOptions SerializationOptions { get; set; }

Property Value

JsonSerializationOptions

StreamingBufferChunkSize

Gets or sets the size of the streaming buffer chunk. Minimum value is 512.

public int StreamingBufferChunkSize { get; set; }

Property Value

int

ThrowExceptions

Gets or sets a value indicating whether exceptions can be thrown during serialization or deserialization. If this is set to false, exceptions will be stored in the Exceptions collection. However, if the number of exceptions is equal to or higher than MaximumExceptionsCount, an exception will be thrown.

public bool ThrowExceptions { get; set; }

Property Value

bool

WriteNamedValueObjectCallback

Gets or sets a callback that is called before an object field or property is serialized.

public JsonCallback WriteNamedValueObjectCallback { get; internal set; }

Property Value

JsonCallback

WriteValueCallback

Gets or sets a write value callback.

public JsonCallback WriteValueCallback { get; internal set; }

Property Value

JsonCallback

Methods

AddException(Exception)

Adds an exception to the list of exceptions.

public void AddException(Exception error)

Parameters

error Exception

The exception to add.

Clone()

Clones this instance.

public JsonOptions Clone()

Returns

JsonOptions

A newly created of this class with all values copied.

FinalizeDeserializationMembers(Type, IEnumerable<MemberDefinition>)

Finalizes the deserialization members from an initial setup of members.

public IEnumerable<MemberDefinition> FinalizeDeserializationMembers(Type type, IEnumerable<MemberDefinition> members)

Parameters

type Type

The input type. May not be null.

members IEnumerable<MemberDefinition>

The members. May not be null.

Returns

IEnumerable<MemberDefinition>

A non-null list of members.

FinalizeSerializationMembers(Type, IEnumerable<MemberDefinition>)

Finalizes the serialization members from an initial setup of members.

public IEnumerable<MemberDefinition> FinalizeSerializationMembers(Type type, IEnumerable<MemberDefinition> members)

Parameters

type Type

The input type. May not be null.

members IEnumerable<MemberDefinition>

The members. May not be null.

Returns

IEnumerable<MemberDefinition>

A non-null list of members.

GetCacheKey()

Gets a key that can be used for type cache.

public string GetCacheKey()

Returns

string

A cache key.

Max(int, int)

Maxes the val 1

public static int Max(int val1, int val2)

Parameters

val1 int

The val

val2 int

The val

Returns

int

The int