Class ArcadeLabelExpression


  • public final class ArcadeLabelExpression
    extends LabelExpression
    An expression script using the Arcade language.

    The label arcade expression expects to hold a legal, Arcade script and to be read and evaluated by an Arcade expression interpreter. An example expression that combines text with a field value is

     "State: " + $feature.State_Name
     

    Note that quotes are needed around the literal text. See https://developers.arcgis.com/arcade/ for full documentation on the Arcade scripting language and its function library.

    Any Arcade functions allowed for the Labeling profile can be used in a label arcade expression. Other functions (for example, FeatureSet functions) are potentially too slow to be used in a dynamic label evaluation.

    Since:
    100.11.0
    • Constructor Detail

      • ArcadeLabelExpression

        public ArcadeLabelExpression()
        Creates a label arcade expression with an empty expression script.

        An empty script is a legal Arcade expression that will evaluate to an empty string.

        Since:
        100.11.0
      • ArcadeLabelExpression

        public ArcadeLabelExpression​(ArcadeExpression arcadeExpression)
        Creates a label arcade expression object with a specified ArcadeExpression.

        Warning: Only the ArcadeExpression.getExpression() is used to construct the ArcadeLabelExpression. The other ArcadeExpression metadata properties are not used or stored.

        Parameters:
        arcadeExpression - An ArcadeExpression containing the Arcade expression string to use. The expression is expected to be a complete, self-contained Arcade expression that calculates a text string.
        Throws:
        IllegalArgumentException - if arcadeExpression is null
        Since:
        100.11.0
      • ArcadeLabelExpression

        public ArcadeLabelExpression​(String arcadeString)
        Creates a label arcade expression object with a specified Arcade expression script string.
        Parameters:
        arcadeString - The Arcade expression script string. The expression is expected to be a complete, self-contained Arcade expression that calculates a text string.
        Throws:
        IllegalArgumentException - if arcadeString is null
        Since:
        100.11.0