C# Class 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; } } }
Inheritance: Amazon.Runtime.Internal.Transform.UnmarshallerContext
Afficher le fichier Open project: aws/aws-sdk-net Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode Description
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

Method Details

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

JsonUnmarshallerContext() public méthode

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
Résultat System

Peek() public méthode

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.
Résultat bool

Peek() public méthode

Peeks at the next (non-whitespace) character in the jsonStream.
public Peek ( ) : int
Résultat int

Read() public méthode

Reads to the next token in the json document, and updates the context accordingly.
public Read ( ) : bool
Résultat bool

ReadText() public méthode

Returns the text contents of the current token being parsed.
public ReadText ( ) : string
Résultat string