JsonSerializable Class

  • JsonSerializable
  • class Esri::ArcGISRuntime::JsonSerializable

    Marker interface inherited by classes that support serialization to and from JSON. More...

    Public Functions

    virtual QString toJson() const = 0
    virtual QJsonObject unknownJson() const = 0
    virtual QJsonObject unsupportedJson() const = 0

    Detailed Description

    JsonSerializable is an abstract, pure virtual base class.

    JsonSerializable is a marker interface in that there are four interface methods (toJson, fromJson, unknownJson, and unsupportedJson) but fromJson is not part of the interface due to technical limitations. The fromJson method is static and cannot be overridden by base classes. All classes that inherit from this abstract base class support all four methods.

    QString json = m_licenseInfo.toJson();
    QFile file(QDir::tempPath() + "/licenseFile.txt");
    file.open(QIODevice::WriteOnly);
    file.write(json.toUtf8());
    file.close();

    Member Function Documentation

    [pure virtual] QString JsonSerializable::toJson() const

    Returns this object as a JSON string.

    This is the pure virtual version of this method. It should be implemented by classes that inherit from this interface.

    [pure virtual] QJsonObject JsonSerializable::unknownJson() const

    Returns the unknown JSON from the source JSON.

    Unknown JSON is a dictionary of values not defined in the ArcGIS specification used to create this object but found in the source JSON. If the object is written back to JSON, any unknown JSON data is not persisted. The ArcGIS specification may be for a web map, web scene, REST API, and so on.

    This is the pure virtual version of this method. It should be implemented by classes that inherit from this interface.

    [pure virtual] QJsonObject JsonSerializable::unsupportedJson() const

    Returns the unsupported data from the source JSON.

    Unsupported JSON is a dictionary of values defined in the ArcGIS specification used to create this object but not currently used in this API. If the object is written back to JSON, any unsupported JSON data is persisted. The ArcGIS specification may be from a web map, web scene, REST API, and so on.

    This is the pure virtual version of this method. It should be implemented by classes that inherit from this interface.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.