CrystalJsonDomWriter

Namespace: SnowBank.Data.Json · class

Constructors

CrystalJsonDomWriter

CrystalJsonDomWriter()

CrystalJsonDomWriter(CrystalJsonSettings settings, ICrystalJsonTypeResolver resolver)

Properties

Resolver

ICrystalJsonTypeResolver Resolver { get; }

Settings

CrystalJsonSettings Settings { get; }

Methods

AreDefaultSettings

static bool AreDefaultSettings(CrystalJsonSettings settings, ICrystalJsonTypeResolver resolver)

BeginArray

JsonArray BeginArray(int capacity = 0)

BeginObject

JsonObject BeginObject(int capacity = 0)

Create

static CrystalJsonDomWriter Create(CrystalJsonSettings settings, ICrystalJsonTypeResolver resolver)

CreateReadOnly

static CrystalJsonDomWriter CreateReadOnly(CrystalJsonSettings settings, ICrystalJsonTypeResolver resolver)

ParseObject

JsonValue ParseObject<T>(T value)

JsonValue ParseObject(object value, Type declaredType, Type runtimeType = null)

Converts an CLR instance into the corresponding JsonValue

  • value — Instance to convert (primitive, value type or reference type)
  • declaredType — Type of the instance, as declared in its parent (ex: Property/Field in a parent class, record or struct. Element type in a collection or array, ...). It can be different from runtimeType (interface, abstract class ...). If unknown, use typeof(object), or specify the same value as runtimeType if the value could not be of any other type.
  • runtimeType — If specified, the actual runtime type of the instance. If null, GetType will be called on value.

Fields

Default

static readonly CrystalJsonDomWriter Default

JSON DOM writer, with default settings

DefaultReadOnly

static readonly CrystalJsonDomWriter DefaultReadOnly

JSON DOM writer, with default settings, that produces read-only values