Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 6.01 KB

File metadata and controls

39 lines (29 loc) · 6.01 KB

stringtemplate

stringtemplate(name, adaptor, controller, data, deps, encoding, failOnError, imports, json, method,
               out, raw, src, startDelim, stopDelim, verbose)

Runs StringTemplate 4 on a set of grammars. The template attributes must be provided by at least one of the controller, data or json attributes.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
adaptor The fully-qualified Java class name of the model adaptor factory to use. The class must have a public no-args constructor and a public no-args method named "adaptors" that returns the mappings between attribute types and model adaptors as java.util.Map<Class<?>, org.stringtemplate.v4.misc.ModelAdaptor> String optional ""
controller The fully-qualified Java class name of the controller to use for attribute injection. The class must have a public no-args constructor and a public method that returns the attributes as java.util.Map<String, Object>. If no method name is specified via the "method" attribute, the method name "attributes" will be assumed. String optional ""
data The data (in JSON format) to use for attribute injection. This data is installed last into the template. If there are name collisions then the value type will be automatically converted into a list type by StringTemplate. String optional ""
deps The dependencies to use. Either to just provide the necessary dependencies for the controller. But can also be used for overriding the default dependencies for StringTemplate. List of labels optional []
encoding The encoding to use for input and output. String optional "UTF-8"
failOnError Sets whether processing should fail on all errors. Enabled by default. When disabled, missing or inaccessible properties don't cause failure. Boolean optional True
imports The templates imported by the template to process. Must include all nested imports as well. List of labels optional []
json The JSON data files to use for attribute injection. The data is installed into the template after the results of the controller, if any. If there are name collisions then the value type will be automatically converted into a list type by StringTemplate. List of labels optional []
method The name of the controller method to invoke. Can be a static or instance method, the type will be automatically detected at invocation time. The return type of the specified method must be of type java.util.Map<String, Object>. String optional ""
out The relative path of the resulting file. String required
raw Use raw template file format (without headers, similar to v3). Requires StringTemplate 4.0.7 or later. Boolean optional False
src The template to process. Label required
startDelim The character to use as start delimiter in templates. String optional "<"
stopDelim The character to use as stop delimiter in templates. String optional ">"
verbose Enable verbose output for template construction. Boolean optional False