Package gg.jte
Interface CodeResolver
public interface CodeResolver
Responsible for resolving template code.
Used by the
TemplateEngine to transfer templates into native Java/Kotlin code.
When running in production with precompiled templates, no CodeResolver is required.-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanChecks if a template with this name exists.longgetLastModified(String name) Resolves the last modification time of a template.Resolves the code of a template.Resolves all template names thisCodeResolvercan resolve.
-
Method Details
-
resolve
Resolves the code of a template.- Parameters:
name- The name of the template, e.g."tag/util/card.jte".- Returns:
- The code of the resolved template, or
nullif no template with this name exists.
-
getLastModified
Resolves the last modification time of a template.- Parameters:
name- The name of the template, e.g."tag/util/card.jte".- Returns:
- The last modification time of this template in milliseconds, or
0Lif no template with this name exists. In case thisCodeResolverdoes not support modification times0Lshould be returned.
-
resolveAllTemplateNames
Resolves all template names thisCodeResolvercan resolve.- Returns:
- A list of all existing templates.
- Throws:
UnsupportedOperationException- in case this operation is not supported by this code resolver
-
exists
Checks if a template with this name exists.- Parameters:
name- The name of the template, e.g."tag/util/card.jte".- Returns:
trueif a template with this name exists, otherwise false.
-