android-components / mozilla.components.lib.jexl / Jexl


class Jexl (source)


Name Summary
<init> Jexl(grammar: Grammar = Grammar())


Name Summary
addTransform fun addTransform(name: String, transform: Transform): Unit
Adds or replaces a transform function in this Jexl instance.
evaluate fun evaluate(expression: String, context: JexlContext = JexlContext()): JexlValue
Evaluates a Jexl string within an optional context.
evaluateBooleanExpression fun evaluateBooleanExpression(expression: String, context: JexlContext = JexlContext(), defaultValue: Boolean? = null): Boolean
Evaluates a Jexl string with an optional context to a Boolean result. Optionally a default value can be provided that will be returned in the expression does not return a boolean result.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.