@Override public void render(@NotNull final String template) { int sep = template.lastIndexOf('.'); if (sep != -1) { String extension = template.substring(sep); final Engine renderEngine = ENGINE.get(extension); if (renderEngine == null) { ctx.fail("No engine registered for extension: " + extension); } else { renderEngine.render(template, ctx); } } else { // when no extension is provided but only 1 engine is available assume that one if (DEFAULT_ENGINE != null) { final Engine renderEngine = ENGINE.get(DEFAULT_ENGINE); renderEngine.render(template, ctx); } else { ctx.fail("Cannot determine the extension of the template"); } } }