Class ArcadeLabelExpression


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

    The Aracade label expression must contain a syntactically correct Arcade script expression.

     "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 valid Arcade expression that will evaluate to an empty string.

        Since:
        100.11.0
      • ArcadeLabelExpression

        public ArcadeLabelExpression​(ArcadeExpression arcadeExpression)
        Creates a label arcade expression object using the ArcadeExpression.getExpression() method.

        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:
        java.lang.IllegalArgumentException - if arcadeExpression is null
        Since:
        100.11.0
      • ArcadeLabelExpression

        public ArcadeLabelExpression​(java.lang.String arcadeString)
        Creates a label arcade expression object with a specified Arcade expression script string. The expression is expected to be a complete, self-contained Arcade expression that calculates a text 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:
        java.lang.IllegalArgumentException - if arcadeString is null
        Since:
        100.11.0