VariableContext (Lucene 10.5.1 expressions API)
Description: declaration: package: org.apache.lucene.expressions.js, class: VariableContext

Package org.apache.lucene.expressions.js

# Class VariableContext

java.lang.Object
org.apache.lucene.expressions.js.VariableContext

public class VariableContext extends Object
A helper to parse the context of a variable name, which is the base variable, followed by the sequence of array (integer or string indexed) and member accesses.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `VariableContext.Type`
  Represents what a piece of a variable does.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final int`
  `integer`
  The integer value for this piece of the variable.
  `final String`
  `text`
  The text of this piece of the variable.
  `final VariableContext.Type`
  `type`
  The type of this piece of a variable.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static final VariableContext[]`
  `parse(String variable)`
  Parses a normalized javascript variable.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### type

    public final VariableContext.Type type
    The type of this piece of a variable.

  - ### text

    public final String text
    The text of this piece of the variable. Used for `VariableContext.Type.MEMBER` and `VariableContext.Type.STR_INDEX` types.

  - ### integer

    public final int integer
    The integer value for this piece of the variable. Used for `VariableContext.Type.INT_INDEX`.

- ## Method Details

  - ### parse

    public static final VariableContext[] parse(String variable)
    Parses a normalized javascript variable. All strings in the variable should be single quoted, and no spaces (except possibly within strings).