An Arcade expression object, containing an expression, a name, a return type and a title. More...
Header: | #include <ArcadeExpression.h> |
Since: | Esri::ArcGISRuntime 100.11 |
Inherits: | Esri::ArcGISRuntime::Object and Esri::ArcGISRuntime::JsonSerializable |
Public Functions
ArcadeExpression(const QString &expression, QObject *parent = nullptr) | |
ArcadeExpression(const QString &expression, const QString &title, const QString &name, QObject *parent = nullptr) | |
ArcadeExpression(const QString &expression, const QString &title, const QString &name, Esri::ArcGISRuntime::ArcadeExpressionReturnType returnType, QObject *parent = nullptr) | |
virtual | ~ArcadeExpression() override |
bool | equals(Esri::ArcGISRuntime::ArcadeExpression *other) const |
QString | expression() const |
QString | name() const |
Esri::ArcGISRuntime::ArcadeExpressionReturnType | returnType() const |
QString | title() const |
Reimplemented Public Functions
virtual QString | toJson() const override |
virtual QJsonObject | unknownJson() const override |
virtual QJsonObject | unsupportedJson() const override |
Static Public Members
Esri::ArcGISRuntime::ArcadeExpression * | fromJson(const QString &json, QObject *parent = nullptr) |
Detailed Description
An ArcadeExpression object gathers an Arcade script expression together with: - the expected return type - the name that a map author uses to refer to it - the title that the author uses to describe the expression
Relevant samples:
- Query features with Arcade expression: Query features on a map using an Arcade expression.
- Set up location-driven Geotriggers: Create a notification every time a given location data source has entered and/or exited a set of features or graphics.
Member Function Documentation
[explicit]
ArcadeExpression::ArcadeExpression (const QString &expression, QObject *parent = nullptr)
Creates a new Arcade expression object with an expression script.
- expression - The Arcade expression to be evaluated. If set to an empty expression string then the evaluation will return empty.
- parent - The optional parent QObject.
The name and title will default to empty strings. The returnType will default to ArcadeExpressionReturnType::Automatic.
ArcadeExpression::ArcadeExpression (const QString &expression, const QString &title, const QString &name, QObject *parent = nullptr)
Creates a new Arcade expression with an expression string, title, and name.
- expression - The Arcade expression to be evaluated. If set to an empty expression string then the evaluation will return empty.
- title - The title of the expression.
- name - The name of the expression.
- parent - The optional parent QObject.
The returnType will default to ArcadeExpressionReturnType::Automatic.
ArcadeExpression::ArcadeExpression (const QString &expression, const QString &title, const QString &name, Esri::ArcGISRuntime::ArcadeExpressionReturnType returnType , QObject *parent = nullptr)
Creates a new Arcade expression with an expression string, title, name, and return type.
- expression - The Arcade expression to be evaluated. If set to an empty expression string then the evaluation will return zero,
false
, an empty string, or empty, depending on whether the returnType is ArcadeExpressionReturnType::Number, ArcadeExpressionReturnType::Boolean, ArcadeExpressionReturnType::String or anything else, respectively. - title - The title of the expression.
- name - The name of the expression.
- returnType - The type to cast the evaluated value to.
- parent - The optional parent QObject.
If the Arcade expression evaluates to a result which differs from ArcadeExpressionReturnType then the result will be cast to the expected return type.
If the cast cannot be carried out, the result will be a type-specific error value. See ArcadeExpressionReturnType for details.
[override virtual]
ArcadeExpression::~ArcadeExpression ()
Destructor.
bool ArcadeExpression::equals(Esri::ArcGISRuntime::ArcadeExpression *other) const
Returns a bool
that tests if two ArcadeExpression objects are equal.
- other - The second object.
QString ArcadeExpression::expression() const
Returns the Arcade expression string.
[static]
Esri::ArcGISRuntime::ArcadeExpression *ArcadeExpression::fromJson (const QString &json, QObject *parent = nullptr)
Creates a new ArcadeExpression from json with an optional parent.
See also JsonSerializable.
QString ArcadeExpression::name() const
Returns the name that the author uses to refer to the expression.
If not set explicitly, then the default is an empty name string.
Esri::ArcGISRuntime::ArcadeExpressionReturnType ArcadeExpression::returnType () const
Returns the expected return type of the expression.
If the Arcade expression creates results of a different type (for example, a Date or an Array), then the result will be cast to the expected return type. If the cast cannot be carried out, the result will be a type-specific error value. ArcadeExpressionReturnType for details.
QString ArcadeExpression::title() const
Returns the title that the author uses to describe the expression.
If not set explicitly, then the default is an empty title string.
[override virtual]
QString ArcadeExpression::toJson () const
Reimplements: JsonSerializable::toJson() const.
Gets the json representation of this object.
See also JsonSerializable.
[override virtual]
QJsonObject ArcadeExpression::unknownJson () const
Reimplements: JsonSerializable::unknownJson() const.
Returns the unknown data 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.
See also JsonSerializable.
[override virtual]
QJsonObject ArcadeExpression::unsupportedJson () const
Reimplements: 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.
See also JsonSerializable.