Class Template
java.lang.Object
io.aiven.kafka.connect.common.templating.Template
A simple templating engine that allows to bind variables to supplier functions.
Variable syntax: {{ variable_name:parameter_name=parameter_value }}. Only alphanumeric characters and
_ are allowed as a variable name. Any number of spaces/tabs inside the braces is allowed. Parameters for
variable name are optional, same as for variable only alphanumeric characters are allowed as a parameter name or a
parameter value.
Non-bound variables are left as is.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classGiven a template, theTemplate.Extractorfinds the matching variables from a string.final class -
Method Summary
Modifier and TypeMethodDescriptioninstance()static TemplatetoString()Creates a new list of variable names.Creates a new set of variable names.List<org.apache.commons.lang3.tuple.Pair<String,VariableTemplatePart.Parameter>> List<org.apache.commons.lang3.tuple.Pair<String,VariableTemplatePart.Parameter>>
-
Method Details
-
originalTemplate
-
variables
Creates a new list of variable names.- Returns:
- A new list of variable names.
-
variablesSet
Creates a new set of variable names.- Returns:
- A new set of variable names.
-
variablesWithParameters
public List<org.apache.commons.lang3.tuple.Pair<String,VariableTemplatePart.Parameter>> variablesWithParameters() -
variablesWithNonEmptyParameters
public List<org.apache.commons.lang3.tuple.Pair<String,VariableTemplatePart.Parameter>> variablesWithNonEmptyParameters() -
instance
-
extractor
-
of
-
toString
-