IJsonValue IJsonValue IJsonValue IJsonValue Interface

Definition

Encapsulates a JSON value.

public : interface IJsonValuepublic interface IJsonValuePublic Interface IJsonValue// This API is not available in Javascript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

ValueType ValueType ValueType ValueType

Gets the type of the encapsulated JSON value. Possible types are defined by JsonValueType.

public : JsonValueType ValueType { get; }public JsonValueType ValueType { get; }Public ReadOnly Property ValueType As JsonValueType// This API is not available in Javascript.

Methods

GetArray() GetArray() GetArray() GetArray()

Returns a pointer to the array if the ValueType of the encapsulated value is Array. If it is not, an exception is thrown.

public : JsonArray GetArray()public JsonArray GetArray()Public Function GetArray() As JsonArray// This API is not available in Javascript.
Returns

A pointer to the encapsulated array.

GetBoolean() GetBoolean() GetBoolean() GetBoolean()

Returns the Boolean if the ValueType of the encapsulated value is Boolean. If it is not, an exception is thrown.

public : PlatForm::Boolean GetBoolean()public bool GetBoolean()Public Function GetBoolean() As bool// This API is not available in Javascript.
Returns
PlatForm::Boolean bool bool bool

The encapsulated value.

GetNumber() GetNumber() GetNumber() GetNumber()

Returns the number (a Double) if the ValueType of the encapsulated value is Number. If it is not, an exception is thrown.

public : double GetNumber()public double GetNumber()Public Function GetNumber() As double// This API is not available in Javascript.
Returns
double double double double

The encapsulated value.

GetObject() GetObject() GetObject() GetObject()

Returns a pointer to the object if the ValueType of the encapsulated value is Object. If it is not, an exception is thrown.

public : JsonObject GetObject()public JsonObject GetObject()Public Function GetObject() As JsonObject// This API is not available in Javascript.
Returns

A pointer to the encapsulated object.

GetString() GetString() GetString() GetString()

Returns the String if the ValueType of the encapsulated value is String. If it is not, an exception is thrown.

public : PlatForm::String GetString()public string GetString()Public Function GetString() As string// This API is not available in Javascript.
Returns
PlatForm::String string string string

The encapsulated String value.

Stringify() Stringify() Stringify() Stringify()

Retrieves the JSON representation of the encapsulated value.

public : PlatForm::String Stringify()public string Stringify()Public Function Stringify() As string// This API is not available in Javascript.
Returns
PlatForm::String string string string

A JSON representation of the encapsulated value.

Remarks

If the ValueType is String, then the returned string will be properly escaped and double quoted. This method is used for serializing the encapsulated value into a valid JSON format.