Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

JsonValue class

Applies to Windows and Windows Phone

Implements the IJsonValue interface which represents a JSON value.

A JsonValue object can represent the three primitive JSON value types of Boolean, Number and String, and can also represent the complex value types of Array and Object by providing ways to access them.

A JsonValue object has overloaded constructors to instantiate a new object from a JSON String, Number or Boolean value and a default constructor that instantiates a JsonValue object with a ValueType of Null.

Syntax


public sealed class JsonValue : IJsonValue

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The JsonValue class has these types of members:

Methods

The JsonValue class has these methods. It also inherits methods from the Object class.

MethodDescription
CreateBooleanValue Creates a JsonValue from a Boolean.
CreateNumberValue Creates a JsonValue from a Number (Double).
CreateStringValue Creates the string for a JsonValue.
GetArray Gets an array if the ValueType of the encapsulated value is Array.
GetBoolean Gets the Boolean if the ValueType of the encapsulated value is Boolean.
GetNumber Gets the number (a Double) if the ValueType of the encapsulated value is Number.
GetObject Gets a JsonObject if the ValueType of the encapsulated value is Object.
GetString Gets a String if the ValueType of the encapsulated value is String.
Parse Parses the specified JSON string into a JsonValue.
Stringify Retrieves the JSON representation of the encapsulated value.
TryParse Parses the specified string into a JsonValue.

 

Properties

The JsonValue class has these properties.

PropertyAccess typeDescription

ValueType

Read-onlyGets the type of the encapsulated JSON value. Possible types are defined by JsonValueType.

 

Remarks

For an example of how these class methods are used to parse a number or string from a JSON string and convert it into a JsonValue object, see Using JavaScript Object Notation (JSON).

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Data.Json
Windows::Data::Json [C++]

Metadata

Windows.winmd

See also

Using JavaScript Object Notation (JSON)

 

 

Show:
© 2014 Microsoft. All rights reserved.