@Test public void testThrowsNPE() throws Exception { try { defaultTemplateRenderer.render(null); fail("should throw NPE"); } catch (NullPointerException ex) { } }
@Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String templateName = renderRequest.getTemplateName(); final SoyTofu.Renderer renderer = compiledTemplates.newRenderer(templateName); final Optional<SoyMapData> soyModel = toSoyDataConverter.toSoyMap(renderRequest.getModel()); setupRenderer(renderer, renderRequest, soyModel); writeResponse(renderer, renderRequest); }
DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String templateName = renderRequest.getTemplateName(); final SoyTofu.Renderer renderer = compiledTemplates.newRenderer(templateName); final Optional<SoyMapData> soyModel = toSoyDataConverter.toSoyMap(renderRequest.getModel()); setupRenderer(renderer, renderRequest, soyModel); writeResponse(renderer, renderRequest); } }
DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String templateName = renderRequest.getTemplateName(); final SoyTofu.Renderer renderer = compiledTemplates.newRenderer(templateName); final Optional<SoyMapData> soyModel = toSoyDataConverter.toSoyMap(renderRequest.getModel()); setupRenderer(renderer, renderRequest, soyModel); writeResponse(renderer, renderRequest); }  }
DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String templateName = renderRequest.getTemplateName(); final SoyTofu.Renderer renderer = compiledTemplates.newRenderer(templateName); final Optional<SoyMapData> soyModel = toSoyDataConverter.toSoyMap(renderRequest.getModel()); setupRenderer(renderer, renderRequest, soyModel); writeResponse(renderer, renderRequest); }  @Override void render(final RenderRequest renderRequest); void setToSoyDataConverter(final ToSoyDataConverter toSoyDataConverter); void setHotReloadMode(boolean hotReloadMode); boolean isHotReloadMode(); boolean isHotReloadModeOff(); }
DefaultTemplateRenderer implements TemplateRenderer { @Override public void render(final RenderRequest renderRequest) throws Exception { if (!renderRequest.getCompiledTemplates().isPresent()) { logger.warn("compiled templates are not present, nothing to render!"); return; } final SoyTofu compiledTemplates = renderRequest.getCompiledTemplates().get(); final String templateName = renderRequest.getTemplateName(); final SoyTofu.Renderer renderer = compiledTemplates.newRenderer(templateName); final Optional<SoyMapData> soyModel = toSoyDataConverter.toSoyMap(renderRequest.getModel()); setupRenderer(renderer, renderRequest, soyModel); writeResponse(renderer, renderRequest); }  @Override void render(final RenderRequest renderRequest); void setToSoyDataConverter(final ToSoyDataConverter toSoyDataConverter); void setHotReloadMode(boolean hotReloadMode); boolean isHotReloadMode(); boolean isHotReloadModeOff();  }