@Test public void testRender() throws WebHookHtmlRendererException { JsonToHtmlPrettyPrintingRenderer j = new JsonToHtmlPrettyPrintingRenderer(); exception.expect(WebHookHtmlRendererException.class); j.render("{sdldsfj {]}"); }
@Override public String render(String uglyJSONString) throws WebHookHtmlRendererException { JsonElement je; try { je = jp.parse(uglyJSONString); return "<pre><code class=\"json\">" + htmlr.render(gson.toJson(je) .replaceAll("\\\\u003c", "<") .replaceAll("\\\\u003e", ">") .replaceAll("\\\\u0026", "&") .replaceAll("\\\\u003d", "=")) + "</code></pre>"; } catch (Exception e){ throw new WebHookHtmlRendererException(e); } }
JsonToHtmlPrettyPrintingRenderer implements WebHookStringRenderer { @Override public String render(String uglyJSONString) throws WebHookHtmlRendererException { JsonElement je; try { je = jp.parse(uglyJSONString); return "<pre><code class=\"json\">" + htmlr.render(gson.toJson(je) .replaceAll("\\\\u003c", "<") .replaceAll("\\\\u003e", ">") .replaceAll("\\\\u0026", "&") .replaceAll("\\\\u003d", "=")) + "</code></pre>"; } catch (Exception e){ throw new WebHookHtmlRendererException(e); } } }
JsonToHtmlPrettyPrintingRenderer implements WebHookStringRenderer { @Override public String render(String uglyJSONString) throws WebHookHtmlRendererException { JsonElement je; try { je = jp.parse(uglyJSONString); return "<pre><code class=\"json\">" + htmlr.render(gson.toJson(je) .replaceAll("\\\\u003c", "<") .replaceAll("\\\\u003e", ">") .replaceAll("\\\\u0026", "&") .replaceAll("\\\\u003d", "=")) + "</code></pre>"; } catch (Exception e){ throw new WebHookHtmlRendererException(e); } }  }
JsonToHtmlPrettyPrintingRenderer implements WebHookStringRenderer { @Override public String render(String uglyJSONString) throws WebHookHtmlRendererException { JsonElement je; try { je = jp.parse(uglyJSONString); return "<pre><code class=\"json\">" + htmlr.render(gson.toJson(je) .replaceAll("\\\\u003c", "<") .replaceAll("\\\\u003e", ">") .replaceAll("\\\\u0026", "&") .replaceAll("\\\\u003d", "=")) + "</code></pre>"; } catch (Exception e){ throw new WebHookHtmlRendererException(e); } }  @Override String render(String uglyJSONString); @Override String render(Map<String, String[]> input); }
JsonToHtmlPrettyPrintingRenderer implements WebHookStringRenderer { @Override public String render(String uglyJSONString) throws WebHookHtmlRendererException { JsonElement je; try { je = jp.parse(uglyJSONString); return "<pre><code class=\"json\">" + htmlr.render(gson.toJson(je) .replaceAll("\\\\u003c", "<") .replaceAll("\\\\u003e", ">") .replaceAll("\\\\u0026", "&") .replaceAll("\\\\u003d", "=")) + "</code></pre>"; } catch (Exception e){ throw new WebHookHtmlRendererException(e); } }  @Override String render(String uglyJSONString); @Override String render(Map<String, String[]> input);  }