Class 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 Detail

      • Context

        public Context​(TemplateRenderer template,
                       FunctionRenderContext context)
        Constructs a context for a template renderer and a render context.
        Parameters:
        template - The template renderer
        context - The function render context
    • Method Detail

      • addArgument

        public TemplateRenderer.Context addArgument​(int index)
        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

        public TemplateRenderer.Context addParameter​(String chunk)
        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