ValueFactory

Factory of Value wrappers from raw data.

See also

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun dictionary(raw: Any, context: Context): DictionaryValue<*>

Converts a raw string input to a dictionary value. A dictionary is a collection of key-value pairs, where keys are strings and values can be expressed in two ways:

Link copied to clipboard
fun enum(raw: Any, values: Array<Enum<*>>): EnumValue?
Link copied to clipboard
fun eval(raw: Any, context: Context, fallback: () -> Expression = { blockMarkdown(raw, context).asNodeValue() }): OutputValue<*>

Evaluates an expression from a raw string input.

Link copied to clipboard

Generates an EvaluableString. Contrary to String, an EvaluableString natively supports function calls and scripting evaluation.

Link copied to clipboard
Link copied to clipboard
fun iterable(raw: Any, context: Context): IterableValue<*>
Link copied to clipboard
fun lambda(raw: Any, context: Context): LambdaValue

Converts a raw string input to a lambda value. Lambda example: param1 param2: Hello, .param1 and .param2!

Link copied to clipboard
fun markdown(lexer: Lexer, context: Context, expandFunctionCalls: Boolean): MarkdownContentValue
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun safeExpression(raw: Any, context: Context, fallback: () -> Expression = { blockMarkdown(raw, context) }): Expression

Evaluates a dynamic expression from a raw string input. This is a safe expression, meaning that if an InvalidExpressionEvalException is caught while evaluating it, the expression is discarded and a fallback expression is used.

Link copied to clipboard
fun size(raw: Any): ObjectValue<Size>
Link copied to clipboard
Link copied to clipboard