Package org.jdbi.v3.core.statement
Interface TemplateEngine.Parsing
-
- All Superinterfaces:
TemplateEngine
- All Known Implementing Classes:
DefinedAttributeTemplateEngine,FreemarkerEngine
- Enclosing interface:
- TemplateEngine
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface @Beta public static interface TemplateEngine.Parsing extends TemplateEngine
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jdbi.v3.core.statement.TemplateEngine
TemplateEngine.Parsing
-
-
Field Summary
-
Fields inherited from interface org.jdbi.v3.core.statement.TemplateEngine
NOP
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<java.util.function.Function<StatementContext,java.lang.String>>parse(java.lang.String template, ConfigRegistry config)Parse a SQL template and return a parsed representation ready to apply to a statement.default java.lang.Stringrender(java.lang.String template, StatementContext ctx)Renders an SQL statement from the given template, using the statement context as needed.
-
-
-
Method Detail
-
render
default java.lang.String render(java.lang.String template, StatementContext ctx)Description copied from interface:TemplateEngineRenders an SQL statement from the given template, using the statement context as needed.- Specified by:
renderin interfaceTemplateEngine- Parameters:
template- The SQL to rewritectx- The statement context for the statement being executed- Returns:
- something which can provide the actual SQL to prepare a statement from and which can bind the correct arguments to that prepared statement
-
parse
java.util.Optional<java.util.function.Function<StatementContext,java.lang.String>> parse(java.lang.String template, 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- Parameters:
template- the sql template to parseconfig- the Jdbi configuration at prepare time- Returns:
- a parsed representation, if available
-
-