Show / Hide Table of Contents

Struct SystemTextAdapter

Struct SystemTextAdapter implements IJson by wrapping a System.Text.Json.JsonElement.

Implements
IJson
Namespace: Jtd.Jtd
Assembly: Jtd.Jtd.dll
Syntax
public struct SystemTextAdapter : IJson
Remarks

System.Text.Json.JsonElement is System.Text.Json's representation of arbitrary JSON data.

You can construct an instance of System.Text.Json.JsonElement using System.Text.Json.JsonDocument.Parse(System.ReadOnlyMemory{System.Byte},System.Text.Json.JsonDocumentOptions) and then taking the System.Text.Json.JsonDocument.RootElement property. You can also use System.Text.Json.JsonSerializer.Deserialize(System.String,System.Type,System.Text.Json.JsonSerializerOptions).

Constructors

| Improve this Doc View Source

SystemTextAdapter(JsonElement)

Constructs a SystemTextAdapter around a JsonElement.

Declaration
public SystemTextAdapter(JsonElement element)
Parameters
Type Name Description
System.Text.Json.JsonElement element

the element to wrap

Methods

| Improve this Doc View Source

AsArray()

Declaration
public IList<IJson> AsArray()
Returns
Type Description
IList<IJson>
| Improve this Doc View Source

AsBoolean()

Declaration
public bool AsBoolean()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

AsNumber()

Declaration
public double AsNumber()
Returns
Type Description
System.Double
| Improve this Doc View Source

AsObject()

Declaration
public IDictionary<string, IJson> AsObject()
Returns
Type Description
IDictionary<System.String, IJson>
| Improve this Doc View Source

AsString()

Declaration
public string AsString()
Returns
Type Description
System.String
| Improve this Doc View Source

IsArray()

Declaration
public bool IsArray()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsBoolean()

Declaration
public bool IsBoolean()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsNull()

Declaration
public bool IsNull()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsNumber()

Declaration
public bool IsNumber()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsObject()

Declaration
public bool IsObject()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

IsString()

Declaration
public bool IsString()
Returns
Type Description
System.Boolean

Implements

IJson

See Also

Validate(Schema, IJson)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX