-
- All Implemented Interfaces:
-
com.clevertap.android.sdk.inapp.customtemplates.TemplateProducer
public class JsonTemplatesProducer implements TemplateProducer
A TemplateProducer that creates templates based on a json definition. Invalid definitions will throw CustomTemplateException when defineTemplates is called.
-
-
Constructor Summary
Constructors Constructor Description JsonTemplatesProducer(String jsonTemplatesDefinition, TemplatePresenter templatesPresenter, FunctionPresenter functionsPresenter)
-
Method Summary
Modifier and Type Method Description Set<CustomTemplate>defineTemplates(CleverTapInstanceConfig ctConfig)Creates CustomTemplates based on the jsonTemplatesDefinition of this JsonTemplatesProducer -
-
Constructor Detail
-
JsonTemplatesProducer
JsonTemplatesProducer(String jsonTemplatesDefinition, TemplatePresenter templatesPresenter, FunctionPresenter functionsPresenter)
- Parameters:
jsonTemplatesDefinition- A string with a json definition of templates in the following format:{ "TemplateName": { "type": "template", "arguments": { "Argument1": { "type": "string|number|boolean|file|action|object", "value": "val" // different type depending on "type", e.g 12.5, true, "str" or {} }, "Argument2": { "type": "object", "value": { "Nested1": { "type": "string|number|boolean|object", // file and action cannot be nested "value": {} }, "Nested2": { "type": "string|number|boolean|object", "value": "val" } } } } }, "functionName": { "type": "function", "isVisual": true|false, "arguments": { "a": { "type": "string|number|boolean|file|object", // action arguments are not supported for functions "value": "val" } } } }templatesPresenter- A presenter for all templates in the json definitions.functionsPresenter- A presenter for all functions in the json definitions.
-
-
Method Detail
-
defineTemplates
Set<CustomTemplate> defineTemplates(CleverTapInstanceConfig ctConfig)
Creates CustomTemplates based on the jsonTemplatesDefinition of this JsonTemplatesProducer
-
-
-
-