IJsonValue IJsonValue IJsonValue Interface

Definition

Encapsulates a JSON value.

public : interface IJsonValue
public interface IJsonValue
Public Interface IJsonValue
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

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
Value
JsonValueType JsonValueType JsonValueType

The JSON value type.

Methods

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
Returns

A pointer to the encapsulated array.

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
Returns
Platform::Boolean bool bool

The encapsulated value.

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
Returns
double double double

The encapsulated value.

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
Returns

A pointer to the encapsulated object.

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
Returns
Platform::String string string

The encapsulated String value.

Stringify() Stringify() Stringify()

Retrieves the JSON representation of the encapsulated value.

public : Platform::String Stringify()
public string Stringify()
Public Function Stringify() As string
Returns
Platform::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.