Options
All
  • Public
  • Public/Protected
  • All
Menu

RegoTerm represent the basic elements that creates an expressions. e.g. An expression a > 4 is made up of 3 terms

  • Reference Term: a
  • Operator Term >
  • Value Term: 4
export

Hierarchy

  • RegoTerm

Index

Constructors

Properties

hasNoResolvableRef: boolean = false

Whether the expression contains any resolvable references. reference start with input. should be considered as non-resolvable in context of partial evaluation. When this field is set to true, we should not attempt to evaluate this expression. i.e. evaluate() method should return immediately. This will speed up evaluation process.

memberof

RegoTerm

parser: default
type: string

Methods

  • asString(): string
  • If it's a reference term, return its full string representation

    memberof

    RegoTerm

    Returns string

  • fullRefString(removalPrefixs?: string[]): string
  • If it's a reference term, return its full string representation Otherwise, throw exception

    memberof

    RegoTerm

    Parameters

    • removalPrefixs: string[] = []

    Returns string

  • Return RegoRef instance if this term is a RegoRef.

    memberof

    RegoTerm

    Returns RegoRef

  • hasCollectionLookup(): boolean
  • If the term is a reference and it contains any collection lookup e.g.

    • objectA.propB.collectionC[_]
    • objectA.propB.collectionC[].ABC[].name
    • objectA.propB.collectionC[_].id
    memberof

    RegoTerm

    Returns boolean

  • isOperator(): boolean
  • If it's a operator term

    memberof

    RegoTerm

    Returns boolean

  • isRef(): boolean
  • If it's a reference term. A operator is an Reference term as well

    memberof

    RegoTerm

    Returns boolean

  • isResolveAsCollectionValue(): boolean
  • isSimpleCollectionLookup(): boolean
  • The term is not only a Reference but a reference contains simple collection lookup i.e. only contains one collection lookup and the whole ref ends with the only collection lookup e.g. objectA.propB.collectionC[] Note: objectA.propB.collectionC[].name is not a simple collection lookup as it resolve to single value (name property) rather than a collection

    memberof

    RegoTerm

    Returns boolean

  • isValueResolvable(): boolean
  • Whether or not the RegoTerm is resolvable

    memberof

    RegoTerm

    Returns boolean

    {boolean}

  • refString(removalPrefixs?: string[]): string
  • If it's a reference term, return its string representation (not include ending [_]) Otherwise, throw exception

    memberof

    RegoTerm

    Parameters

    • removalPrefixs: string[] = []

    Returns string

  • toConciseJSON(): string
  • toJson(): string

Generated using TypeDoc