@Override
public ExecutionContext setTemplateInvocation(Template template) {
if (invocationLimitCounter < 0
&& getTemplateInvocations(template) > configuration
.getIntegerPropertyValue(EngineConfigurationKey.TEMPLATE_RECURSIVE_INVOCATION_LIMIT)) {
throw new MustacheException(
MustacheProblem.RENDER_TEMPLATE_INVOCATION_RECURSIVE_LIMIT_EXCEEDED,
"Recursive invocation limit exceeded [limit: %s, level: %s, template: %s]",
configuration
.getIntegerPropertyValue(EngineConfigurationKey.TEMPLATE_RECURSIVE_INVOCATION_LIMIT),
invocationLimitCounter, templateInvocation);
}
return new DefaultExecutionContext(this, configuration, null, template,
invocationLimitCounter - 1, null, resolvers, converters);
}