JsonElement.TryParseValue(Utf8JsonReader, Nullable<JsonElement>) 메서드

정의

제공된 판독기에서 하나의 JSON 값(개체 또는 배열 포함)을 구문 분석하려고 시도합니다.

public:
 static bool TryParseValue(System::Text::Json::Utf8JsonReader % reader, [Runtime::InteropServices::Out] Nullable<System::Text::Json::JsonElement> % element);
public static bool TryParseValue(ref System.Text.Json.Utf8JsonReader reader, out System.Text.Json.JsonElement? element);
static member TryParseValue : Utf8JsonReader * Nullable -> bool
Public Shared Function TryParseValue (ByRef reader As Utf8JsonReader, ByRef element As Nullable(Of JsonElement)) As Boolean

매개 변수

reader
Utf8JsonReader

읽을 판독기입니다.

element
Nullable<JsonElement>

구문 분석된 요소를 받습니다.

반품

true 값을 읽고 JsonElement로 구문 분석한 경우 false 구문 분석하는 동안 판독기에서 데이터가 부족하면 입니다. 다른 모든 상황에서는 예외가 throw됩니다.

예외

reader 은 지원되지 않는 옵션을 사용하고 있습니다.

현재 reader 토큰이 시작되거나 값을 나타내지 않습니다.

판독기에서 값을 읽을 수 없습니다.

설명

속성 readerTokenType 있는 PropertyNameNone경우 판독기는 값의 시작을 확인하기 위해 Read() 한 번의 호출로 진행됩니다.

이 메서드 reader 가 완료되면 JSON 값의 최종 토큰에 배치됩니다. 예외가 throw되거나 false 반환되면 판독기는 메서드가 호출되었을 때의 상태로 다시 설정됩니다.

이 메서드는 판독기가 작업한 데이터의 복사본을 만들므로 이 메서드의 반환 이후에도 데이터 무결성을 유지하기 위한 호출자 요구 사항이 없습니다.

적용 대상