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
Object → DefaultValueJsonDocument
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
Methods
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