Class FreemarkerEngine
java.lang.Object
org.jdbi.v3.freemarker.FreemarkerEngine
- All Implemented Interfaces:
TemplateEngine, TemplateEngine.Parsing
Rewrites a Freemarker template, using the attributes on the
StatementContext as template parameters.-
Nested Class Summary
Nested classes/interfaces inherited from interface TemplateEngine
TemplateEngine.Parsing -
Field Summary
Fields inherited from interface TemplateEngine
NOPModifier and TypeFieldDescriptionstatic final TemplateEngineConvenience constant that returns the input template. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic FreemarkerEngineinstance()parse(String sqlTemplate, ConfigRegistry config) Parse a SQL template and return a parsed representation ready to apply to a statement.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TemplateEngine.Parsing
renderModifier and TypeMethodDescriptiondefault Stringrender(String template, StatementContext ctx) Renders an SQL statement from the given template, using the statement context as needed.
-
Constructor Details
-
FreemarkerEngine
Deprecated, for removal: This API element is subject to removal in a future version.useinstance()for a shared engine instead
-
-
Method Details
-
instance
-
parse
public Optional<Function<StatementContext, String>> parse(String sqlTemplate, ConfigRegistry config) Description copied from interface:TemplateEngineParse a SQL template and return a parsed representation ready to apply to a statement. This allows the parsed representation to be cached and reused.- Specified by:
parsein interfaceTemplateEngine- Specified by:
parsein interfaceTemplateEngine.Parsing- Parameters:
sqlTemplate- the sql template to parseconfig- the Jdbi configuration at prepare time- Returns:
- a parsed representation, if available
-
instance()for a shared engine instead