Package io.github.erdos.stencil
Class TemplateVariables
java.lang.Object
io.github.erdos.stencil.TemplateVariables
Holds information about variables found in template file. Can be used to validate template data.
A variable path looks like the following.
A.B.C[].D
A path is a string that contains tokens separated with . (dot) characters. The tokens represents keys in maps.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateVariables
fromPaths
(Collection<String> allVariablePaths, Collection<String> allFragmentNames) Returns all variable paths as an immutable set.void
throwWhenInvalid
(TemplateData templateData) Throws IllegalArgumentException exception when template data is missing values for schema.
-
Method Details
-
fromPaths
public static TemplateVariables fromPaths(Collection<String> allVariablePaths, Collection<String> allFragmentNames) -
getAllVariables
Returns all variable paths as an immutable set. -
getAllFragmentNames
-
throwWhenInvalid
Throws IllegalArgumentException exception when template data is missing values for schema.Throws when referred keys are missing from data.
- Throws:
IllegalArgumentException
- then parameter does not match patternNullPointerException
- when parameter is null.
-