Class LabelExpression

java.lang.Object
com.esri.arcgisruntime.mapping.labeling.LabelExpression
Direct Known Subclasses:
ArcadeLabelExpression, SimpleLabelExpression, WebmapLabelExpression

public abstract class LabelExpression extends Object
Abstract base class for the different types of expressions that can be used to create label text.

Users can read the expression script using the getExpression() property. To specify an expression script, users create an object of type ArcadeLabelExpression, SimpleLabelExpression or WebmapLabelExpression with the required expression script and assign it to the label expression object.

Since:
100.11.0
  • Method Details

    • getExpression

      public String getExpression()
      Gets the label expression script string.

      The expression is expected to be a complete, self-contained label expression in the language specified by the label expression subclass object.

      Returns:
      the label expression script string
      Since:
      100.11.0
    • setExpression

      public void setExpression(String expression)
      Sets the label expression script string.

      The expression is expected to be a complete, self-contained label expression in the language specified by the label expression subclass object.

      Warning: If the expression attempts to use attributes which don't exist then no label will be produced. This is distinct from the attribute existing but having a null or empty value, which can form part of the produced text label.

      Parameters:
      expression - the label expression script string
      Throws:
      IllegalArgumentException - if expression is null
      Since:
      100.11.0