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
Show file Open project: aws/aws-sdk-net Class Usage Examples

Public Methods

Method 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.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method 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 method

protected Dispose ( bool disposing ) : void
disposing bool
return void

JsonUnmarshallerContext() public method

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
return System

Peek() public method

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.
return bool

Peek() public method

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

Read() public method

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

ReadText() public method

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