Skip to content

DefaultValueJsonDocument

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: DefaultValueJsonDocument.cs

A read-only IMutableJsonDocument facade over an immutable document, used to back the mutable view of a schema default value (issue #811).

public sealed class DefaultValueJsonDocument : IMutableJsonDocument, IWorkspaceManagedDocument, IJsonDocument, IDisposable

Remarks

A mutable element (T.Mutable) must be backed by an IMutableJsonDocument, but a schema default is materialised as an immutable instance. This facade lets an absent, non-nullable defaulted property be surfaced through the mutable view without copying any data: every read is forwarded to the wrapped immutable inner document, and every mutating operation throws an InvalidOperationException whose message tells the caller to set the value on its parent before modifying it. This type owns no resources — it merely wraps inner — so Dispose is a no-op and never disposes the wrapped document.

Inheritance

ObjectDefaultValueJsonDocument

Implements

IMutableJsonDocument, IWorkspaceManagedDocument, IJsonDocument, IDisposable

Constructors

Constructor Description
DefaultValueJsonDocument(IJsonDocument) A read-only IMutableJsonDocument facade over an immutable document, used to back the mutable view of a schema default value (issue...

Properties

Property Type Description
CachedWorkspace JsonWorkspace?
CachedWorkspaceDocumentIndex int
CachedWorkspaceGeneration int
IsDisposable bool
IsImmutable bool
ParentWorkspaceIndex int
Version ulong
Workspace JsonWorkspace

Methods

Method Description
AppendElementToMetadataDb(int, JsonWorkspace, MetadataDb)
BuildRentedMetadataDb(int, JsonWorkspace, byte[])
CloneElement
CopyValueToArrayEnd(int, int)
CopyValueToArrayIndex(int, int, int)
CopyValueToProperty(int, int, ReadOnlySpan<byte>)
Dispose() Does nothing: this facade does not own the wrapped document, so it must not dispose it.
EnsurePropertyMap(int)
EscapeAndStoreRawStringValue
FreezeElement(int)
GetArrayIndexElement
GetArrayInsertionIndex(int, int)
GetArrayLength(int)
GetDbSize(int, bool)
GetHashCode(int)
GetJsonTokenType(int)
GetNameOfPropertyValue(int)
GetPropertyCount(int)
GetPropertyName(int)
GetPropertyNameRaw
GetPropertyNameUnescaped(int)
GetPropertyRawValueAsString(int)
GetRawSimpleValue
GetRawSimpleValueUnsafe(int)
GetRawValue(int, bool)
GetRawValueAsString(int)
GetStartIndex(int)
GetString(int, JsonTokenType)
GetUtf16JsonString(int, JsonTokenType)
GetUtf8JsonString(int, JsonTokenType)
InsertAndDispose(int, int, ComplexValueBuilder)
InsertFromDocument(int, int, int, IJsonDocument, int)
InsertPropertyFromDocument(int, int, int, ReadOnlySpan<byte>, IJsonDocument, int)
InsertSimpleProperty(int, int, int, ReadOnlySpan<byte>, JsonTokenType, int, int)
InsertSimpleValue(int, int, int, JsonTokenType, int, int)
MoveItemToArray(int, int, int, int)
MoveItemToArrayEnd(int, int, int)
MoveItemToProperty(int, int, int, ReadOnlySpan<byte>)
MovePropertyToArray(int, ReadOnlySpan<byte>, int, int)
MovePropertyToArrayEnd(int, ReadOnlySpan<byte>, int)
MovePropertyToProperty(int, ReadOnlySpan<byte>, int, ReadOnlySpan<byte>)
OverwriteAndDispose(int, int, int, int, ComplexValueBuilder)
OverwriteFromDocument(int, int, int, int, IJsonDocument, int)
OverwriteSimpleValue(int, int, int, int, JsonTokenType, int, int)
RefreshElementUnsafe(int)
RemoveRange(int, int, int, int)
ReplaceRootAndDispose(ComplexValueBuilder)
SetAndDispose(ComplexValueBuilder)
StoreBooleanValue(bool)
StoreNullValue()
StorePrebakedValue(ReadOnlySpan<byte>)
StoreRawNumberValue(ReadOnlySpan<byte>)
StoreRawStringValue(ReadOnlySpan<byte>)
StoreValue
TextEquals
ToString
TryFindNextDescendantPropertyValue(int, int, ReadOnlySpan<byte>, int)
TryFormat
TryGetLine
TryGetLineAndOffset(int, int, int, long)
TryGetLineAndOffsetForPointer(ReadOnlySpan<byte>, int, int, int, long)
TryGetNamedPropertyValue
TryGetNamedPropertyValueIndex
TryGetString(int, JsonTokenType, string?)
TryGetValue
TryReplacePropertyFromDocument(int, ReadOnlySpan<byte>, IJsonDocument, int)
TryReplacePropertyValue(int, ReadOnlySpan<byte>, JsonTokenType, int, int)
TryResolveJsonPointer(ReadOnlySpan<byte>, int, TValue)
ValueIsEscaped(int, bool)
WriteElementTo(int, Utf8JsonWriter)
WriteElementToMetadataDb(int, JsonWorkspace, MetadataDb, int)
WritePropertyName(int, Utf8JsonWriter)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue