Package com.blazebit.persistence.spi
Class TemplateRenderer.Context
java.lang.Object
com.blazebit.persistence.spi.TemplateRenderer.Context
- Enclosing class:
- TemplateRenderer
public static class TemplateRenderer.Context extends Object
A context for a template renderer that supports binding function arguments or plain strings as values for placeholders.
-
Constructor Summary
Constructors Constructor Description Context(TemplateRenderer template, FunctionRenderContext context)
Constructs a context for a template renderer and a render context. -
Method Summary
Modifier and Type Method Description TemplateRenderer.Context
addArgument(int index)
Uses the value of the argument at the given index as value to be bound to the current parameter.TemplateRenderer.Context
addParameter(String chunk)
Uses the given chunk as value to be bound to the current parameter.void
build()
Binds the values to the underlyingFunctionRenderContext
.
-
Constructor Details
-
Context
Constructs a context for a template renderer and a render context.- Parameters:
template
- The template renderercontext
- The function render context
-
-
Method Details
-
addArgument
Uses the value of the argument at the given index as value to be bound to the current parameter.- Parameters:
index
- The index of the argument- Returns:
- This context for chaining
-
addParameter
Uses the given chunk as value to be bound to the current parameter.- Parameters:
chunk
- The chunk to use as value- Returns:
- This context for chaining
-
build
public void build()Binds the values to the underlyingFunctionRenderContext
.
-