IJsonValue IJsonValue IJsonValue Interface

Encapsulates a JSON value.

Syntax

Declaration

public interface IJsonValuepublic interface IJsonValuePublic Interface IJsonValue

Properties summary

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

Methods summary

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

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

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

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

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

Retrieves the JSON representation of the encapsulated value.

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 JsonValueTypepublic JsonValueType ValueType { get; }

    Property Value

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 JsonArraypublic JsonArray GetArray()

    Returns

  • 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 bool GetBoolean()public bool GetBoolean()Public Function GetBoolean() As boolpublic bool GetBoolean()

    Returns

    • 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 doublepublic double GetNumber()

    Returns

    • 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 JsonObjectpublic JsonObject GetObject()

    Returns

  • 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 string GetString()public string GetString()Public Function GetString() As stringpublic string GetString()

    Returns

    • string
      string
      string

      The encapsulated String value.

  • Stringify()
    Stringify()
    Stringify()
    Stringify()

    Retrieves the JSON representation of the encapsulated value.

    public string Stringify()public string Stringify()Public Function Stringify() As stringpublic string Stringify()

    Returns

    • 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.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.GuidAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.Data.Json.dll