Package 

Class 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.