C# Class Newtonsoft.Json.JsonValidatingReader

Represents a reader that provides JsonSchema validation.
Inheritance: JsonReader, IJsonLineInfo
显示文件 Open project: JamesNK/Newtonsoft.Json Class Usage Examples

Private Properties

Property Type Description
FloatingPointRemainder double
GetCurrentNodeSchemaType JsonSchemaType?
IJsonLineInfo bool
IsPropertyDefinied bool
IsZero bool
OnValidationEvent void
Pop SchemaScope
ProcessValue void
Push void
RaiseError void
TestType bool
ValidateArray bool
ValidateBoolean void
ValidateCurrentToken void
ValidateEndArray void
ValidateEndObject void
ValidateFloat void
ValidateInteger void
ValidateNotDisallowed void
ValidateNull void
ValidateObject bool
ValidatePropertyName void
ValidateString void
WriteToken void

Public Methods

Method Description
JsonValidatingReader ( JsonReader reader ) : System

Initializes a new instance of the JsonValidatingReader class that validates the content returned from the given JsonReader.

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.

Private Methods

Method Description
FloatingPointRemainder ( double dividend, double divisor ) : double
GetCurrentNodeSchemaType ( ) : JsonSchemaType?
IJsonLineInfo ( ) : bool
IsPropertyDefinied ( JsonSchemaModel schema, string propertyName ) : bool
IsZero ( double value ) : bool
OnValidationEvent ( JsonSchemaException exception ) : void
Pop ( ) : SchemaScope
ProcessValue ( ) : void
Push ( SchemaScope scope ) : void
RaiseError ( string message, JsonSchemaModel schema ) : void
TestType ( JsonSchemaModel currentSchema, JsonSchemaType currentType ) : bool
ValidateArray ( JsonSchemaModel schema ) : bool
ValidateBoolean ( JsonSchemaModel schema ) : void
ValidateCurrentToken ( ) : void
ValidateEndArray ( JsonSchemaModel schema ) : void
ValidateEndObject ( JsonSchemaModel schema ) : void
ValidateFloat ( JsonSchemaModel schema ) : void
ValidateInteger ( JsonSchemaModel schema ) : void
ValidateNotDisallowed ( JsonSchemaModel schema ) : void
ValidateNull ( JsonSchemaModel schema ) : void
ValidateObject ( JsonSchemaModel schema ) : bool
ValidatePropertyName ( JsonSchemaModel schema ) : void
ValidateString ( JsonSchemaModel schema ) : void
WriteToken ( IList schemas ) : void

Method Details

JsonValidatingReader() public method

Initializes a new instance of the JsonValidatingReader class that validates the content returned from the given JsonReader.
public JsonValidatingReader ( JsonReader reader ) : System
reader JsonReader The to read from while validating.
return System

Read() public method

Reads the next JSON token from the stream.
public 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