C# Class Newtonsoft.Json.JsonReader

Represents a reader that provides fast, non-cached, forward-only access to serialized Json data.
Inheritance: IDisposable
显示文件 Open project: JamesNK/Newtonsoft.Json Class Usage Examples

Public Methods

Method Description
Close ( ) : void

Changes the reader's state to JsonReader.State.Closed.

Read ( ) : bool

Reads the next JSON token from the stream.

ReadAsBoolean ( ) : bool?

Reads the next JSON token from the stream as a Nullable{T} of Boolean.

ReadAsBytes ( ) : byte[]

Reads the next JSON token from the stream as a Byte[].

ReadAsDateTime ( ) : DateTime?

Reads the next JSON token from the stream as a Nullable{T} of DateTime.

ReadAsDateTimeOffset ( ) : DateTimeOffset?

Reads the next JSON token from the stream as a Nullable{T} of DateTimeOffset.

ReadAsDecimal ( ) : decimal?

Reads the next JSON token from the stream as a Nullable{T} of Decimal.

ReadAsDouble ( ) : double?

Reads the next JSON token from the stream as a Nullable{T} of Double.

ReadAsInt32 ( ) : int?

Reads the next JSON token from the stream as a Nullable{T} of Int32.

ReadAsString ( ) : string

Reads the next JSON token from the stream as a String.

Skip ( ) : void

Skips the children of the current token.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources.

JsonReader ( ) : System

Initializes a new instance of the JsonReader class.

SetStateBasedOnCurrent ( ) : void

Sets the state based on current token type.

SetToken ( JsonToken newToken ) : void

Sets the current token.

SetToken ( JsonToken newToken, object value ) : void

Sets the current token and value.

Private Methods

Method Description
CreateUnexpectedEndException ( ) : JsonReaderException
GetContentToken ( ) : JsonToken
GetPosition ( int depth ) : Newtonsoft.Json.JsonPosition
GetTypeForCloseToken ( JsonToken token ) : JsonContainerType
IDisposable ( ) : void
MoveToContent ( ) : bool
Peek ( ) : JsonContainerType
Pop ( ) : JsonContainerType
Push ( JsonContainerType value ) : void
ReadAndAssert ( ) : void
ReadAndMoveToContent ( ) : bool
ReadArrayIntoByteArray ( ) : byte[]
ReadBooleanString ( string s ) : bool?
ReadDateTimeOffsetString ( string s ) : DateTimeOffset?
ReadDateTimeString ( string s ) : DateTime?
ReadDecimalString ( string s ) : decimal?
ReadDoubleString ( string s ) : double?
ReadInt32String ( string s ) : int?
ReadIntoWrappedTypeObject ( ) : void
ReaderReadAndAssert ( ) : void
SetFinished ( ) : void
SetPostValueState ( bool updateIndex ) : void
SetToken ( JsonToken newToken, object value, bool updateIndex ) : void
UpdateScopeWithFinishedValue ( ) : void
ValidateEnd ( JsonToken endToken ) : void

Method Details

Close() public method

Changes the reader's state to JsonReader.State.Closed.
public Close ( ) : void
return void

Dispose() protected method

Releases unmanaged and - optionally - managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

JsonReader() protected method

Initializes a new instance of the JsonReader class.
protected JsonReader ( ) : System
return System

Read() public abstract method

Reads the next JSON token from the stream.
public abstract Read ( ) : bool
return bool

ReadAsBoolean() public method

Reads the next JSON token from the stream as a Nullable{T} of Boolean.
public ReadAsBoolean ( ) : bool?
return bool?

ReadAsBytes() public method

Reads the next JSON token from the stream as a Byte[].
public ReadAsBytes ( ) : byte[]
return byte[]

ReadAsDateTime() public method

Reads the next JSON token from the stream as a Nullable{T} of DateTime.
public ReadAsDateTime ( ) : DateTime?
return DateTime?

ReadAsDateTimeOffset() public method

Reads the next JSON token from the stream as a Nullable{T} of DateTimeOffset.
public ReadAsDateTimeOffset ( ) : DateTimeOffset?
return DateTimeOffset?

ReadAsDecimal() public method

Reads the next JSON token from the stream as a Nullable{T} of Decimal.
public ReadAsDecimal ( ) : decimal?
return decimal?

ReadAsDouble() public method

Reads the next JSON token from the stream as a Nullable{T} of Double.
public ReadAsDouble ( ) : double?
return double?

ReadAsInt32() public method

Reads the next JSON token from the stream as a Nullable{T} of Int32.
public ReadAsInt32 ( ) : int?
return int?

ReadAsString() public method

Reads the next JSON token from the stream as a String.
public ReadAsString ( ) : string
return string

SetStateBasedOnCurrent() protected method

Sets the state based on current token type.
protected SetStateBasedOnCurrent ( ) : void
return void

SetToken() protected method

Sets the current token.
protected SetToken ( JsonToken newToken ) : void
newToken JsonToken The new token.
return void

SetToken() protected method

Sets the current token and value.
protected SetToken ( JsonToken newToken, object value ) : void
newToken JsonToken The new token.
value object The value.
return void

Skip() public method

Skips the children of the current token.
public Skip ( ) : void
return void