Package org.jdbi.v3.core.statement
Class MessageFormatTemplateEngine
java.lang.Object
org.jdbi.v3.core.statement.MessageFormatTemplateEngine
- All Implemented Interfaces:
- TemplateEngine
Deprecated.
Uses the equivalent of 
MessageFormat.format(String, Object...) as a template engine.
 You must use "0", "1", "2", etc as keys: start at 0, increment by 1. Keys must be numerically unique. You must Configurable.define(String, Object) as many key/value pairs as there are placeholders in the pattern string.
 You may define key/value pairs in any order. Keys may contain leading '0's.
 Any invalid use will trigger an IllegalArgumentException (or subclasses such as NumberFormatException) when render(String, StatementContext) is called – typically when the statement is about to be executed.
 Example usage:
 
     // select bar from foo where col = 'abc'
     jdbi.useHandle(handle -> handle.createCall("select {1} from {0} where col = ''{2}''")
         .setTemplateEngine(MessageFormatTemplateEngine.INSTANCE)
         .define("0", "foo")
         .define("1", "bar")
         .define("2", "abc")
         .invoke());
 - 
Nested Class SummaryNested classes/interfaces inherited from interface org.jdbi.v3.core.statement.TemplateEngineTemplateEngine.Parsing
- 
Field SummaryFields inherited from interface org.jdbi.v3.core.statement.TemplateEngineNOP
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionrender(String template, StatementContext ctx) Deprecated.Renders an SQL statement from the given template, using the statement context as needed.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.statement.TemplateEngineparse
- 
Constructor Details- 
MessageFormatTemplateEnginepublic MessageFormatTemplateEngine()Deprecated.
 
- 
- 
Method Details- 
renderDeprecated.Description copied from interface:TemplateEngineRenders an SQL statement from the given template, using the statement context as needed.- Specified by:
- renderin interface- TemplateEngine
- Parameters:
- template- The SQL to rewrite
- ctx- 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
 
 
- 
MessageFormatformats integers with decimal separators, e.g.1000→"1,000". This hindsight realization has led us to discourage its use.