IJsonValue IJsonValue IJsonValue IJsonValue Interface

Definition

Encapsulates a JSON value.

public : interface IJsonValue
public interface IJsonValue
Public Interface IJsonValue
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
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
var jsonValueType = iJsonValue.valueType;

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
var jsonArray = iJsonValue.getArray();
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
var bool = iJsonValue.getBoolean();
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
var double = iJsonValue.getNumber();
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
var jsonObject = iJsonValue.getObject();
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
var string = iJsonValue.getString();
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
var string = iJsonValue.stringify();
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.