Class CelAttribute


  • @Immutable
    public abstract class CelAttribute
    extends java.lang.Object
    CelAttribute represents the select path from the root (.) to a single leaf value that may be derived from the activation (e.g. .com.google.Attribute['index'])

    This includes fully qualified identifiers and the selection path to a member field or element.

    CelAttributes are represented as a list of qualifiers (select/index operations) from the root, e.g. identifier[2].field is represented as string:identifier, int:2, string:field.

    • Field Detail

      • EMPTY

        public static final CelAttribute EMPTY
        Empty attribute. Represents a value that doesn't have a corresponding attribute (e.g. the result of a function).
    • Constructor Detail

      • CelAttribute

        public CelAttribute()
    • Method Detail

      • create

        public static CelAttribute create​(java.lang.String rootIdentifier)
        Creates a CelAttribute from a single root identifier.
      • fromQualifiedIdentifier

        public static CelAttribute fromQualifiedIdentifier​(java.lang.String qualifiedIdentifier)
        Attempts to parse a dot qualified identifier into a CEL attribute.
        Throws:
        java.lang.IllegalArgumentException - if qualifiedIdentifier isn't a legal qualified identifier. Note: this is intended for use with reference names in a checked CEL expression -- it does not check for some edge cases (e.g. reserved words).
      • qualifiers

        public abstract com.google.common.collect.ImmutableList<CelAttribute.Qualifier> qualifiers()
        The list of qualifiers representing the select path for this attribute.
      • qualify

        public CelAttribute qualify​(CelAttribute.Qualifier qualifier)
        Creates a new attribute that is more qualified (has an additional select or index operation) than the receiver.
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object