Target filter
Search Kotlin docs
  • Platforms
  • Tealium Prism Kotlin
core/com.tealium.prism.core.api.misc/TemplateProcessor

TemplateProcessor

object TemplateProcessor

Utility object for injecting dynamic values into templates.

For example, given the following template and input context

Template:

Hello, {{user.name}}. Context:

{
"user": {
"name": "Bill"
}
}
Content copied to clipboard

The processed template would output

Hello, Bill.

In cases where the value may not be available in the context, a fallback string can be provided to be used instead. So given the following template and input context:

Template:

Hello, {{user.name || beloved user}}. Context:

{
"user": {
"age": 42
}
}
Content copied to clipboard

The processed template would output

Hello, beloved user.

Functions

process
Link copied to clipboard
fun process(template: String, context: DataObject): String

Processes the input template looking for all occurrences of double brace wrapped text: {{ }}

Generated by Dokka
(c) Tealium 2026