android-components / mozilla.components.lib.jexl.evaluator / JexlContext

# JexlContext

`class JexlContext` (source)

Variables defined in the JexlContext are available to expressions.

Example context: val context = JexlContext( "employees" to JexlArray( JexlObject( "first" to "Sterling".toJexl(), "last" to "Archer".toJexl(), "age" to 36.toJexl()), JexlObject( "first" to "Malory".toJexl(), "last" to "Archer".toJexl(), "age" to 75.toJexl()), JexlObject( "first" to "Malory".toJexl(), "last" to "Archer".toJexl(), "age" to 33.toJexl()) ) )

This context can be accessed in an JEXL expression like this:

### Constructors

<init> | `JexlContext(vararg pairs: Pair<String, JexlValue>)` Variables defined in the JexlContext are available to expressions.

### Functions

get | `fun get(key: String): JexlValue`
set | `fun set(key: String, value: JexlValue): Unit`