MustacheRenderer implements Renderer { @Override public boolean isRenderable(String path, Request request) { if (path == null) { return false; } if (acceptPattern != null) { final Matcher matcher = acceptPattern.matcher(path); return matcher.matches(); } return true; } MustacheRenderer();  MustacheRenderer(MustacheFactory factory); @Override void render(String path, Request request); static Request getThreadLocalRequest(); @Override boolean isRenderable(String path, Request request); final void setAcceptPattern(Pattern acceptPattern);  }
@Test public void testIsRenderable() { MustacheRenderer renderer = new MustacheRenderer(); final Pattern pattern = Pattern.compile("/.*"); renderer.setAcceptPattern(pattern); assertTrue(renderer.isRenderable("/my/template.html", null)); assertTrue(renderer.isRenderable("/my/template.any", null)); assertFalse(renderer.isRenderable("my/template.html", null)); assertFalse(renderer.isRenderable(null, null)); }