C# Класс Amazon.Runtime.Internal.Transform.JsonUnmarshallerContext

Wraps a json string for unmarshalling. Each Read() operation gets the next token. TestExpression() is used to match the current key-chain to an xpath expression. The general pattern looks like this: JsonUnmarshallerContext context = new JsonUnmarshallerContext(jsonString); while (context.Read()) { if (context.IsKey) { if (context.TestExpresion("path/to/element")) { myObject.stringMember = stringUnmarshaller.GetInstance().Unmarshall(context); continue; } } }
Наследование: Amazon.Runtime.Internal.Transform.UnmarshallerContext
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
JsonUnmarshallerContext ( Stream responseStream, bool maintainResponseBody, IWebResponseData responseData ) : System

Wrap the jsonstring for unmarshalling.

Peek ( JsonToken token ) : bool

Peeks at the next token. This peek implementation reads the next token and makes the subsequent Read() return the same data. If Peek is called successively, it will return the same data. Only the first one calls Read(), subsequent calls will return the same data until a Read() call is made.

Peek ( ) : int

Peeks at the next (non-whitespace) character in the jsonStream.

Read ( ) : bool

Reads to the next token in the json document, and updates the context accordingly.

ReadText ( ) : string

Returns the text contents of the current token being parsed.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Приватные методы

Метод Описание
StreamPeek ( ) : int

Peeks at the next character in the stream. If the data isn't buffered into the StreamReader (Peek() returns -1), we flush the buffered data and try one more time.

UpdateContext ( ) : void

Описание методов

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

JsonUnmarshallerContext() публичный Метод

Wrap the jsonstring for unmarshalling.
public JsonUnmarshallerContext ( Stream responseStream, bool maintainResponseBody, IWebResponseData responseData ) : System
responseStream Stream Stream that contains the JSON for unmarshalling
maintainResponseBody bool If set to true, maintains a copy of the complete response body as the stream is being read.
responseData IWebResponseData Response data coming back from the request
Результат System

Peek() публичный Метод

Peeks at the next token. This peek implementation reads the next token and makes the subsequent Read() return the same data. If Peek is called successively, it will return the same data. Only the first one calls Read(), subsequent calls will return the same data until a Read() call is made.
public Peek ( JsonToken token ) : bool
token JsonToken Token to peek.
Результат bool

Peek() публичный Метод

Peeks at the next (non-whitespace) character in the jsonStream.
public Peek ( ) : int
Результат int

Read() публичный Метод

Reads to the next token in the json document, and updates the context accordingly.
public Read ( ) : bool
Результат bool

ReadText() публичный Метод

Returns the text contents of the current token being parsed.
public ReadText ( ) : string
Результат string