Package com.uwyn.jhighlight.renderer

Examples of com.uwyn.jhighlight.renderer.Renderer


        return null;
    }

    public static String highlightStream(String name, InputStream input, String rendererName, String encoding) throws IOException {

        Renderer jspRenderer = XhtmlRendererFactory.getRenderer(rendererName);
        if (jspRenderer != null) {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            jspRenderer.highlight(name, input, bos, encoding, true);

            ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());

            Tokenizer tokenizer = new Tokenizer(new InputStreamReader(bis, encoding));
            tokenizer.addSymbol(new TokenizerSymbol("EOL", "\n", null, false, false, true, false));
View Full Code Here


        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true)
          .toString()
          .replaceAll("\n", "<br />");
View Full Code Here

            }
            nbLines ++;
        }
        metadata.set("LoC", String.valueOf(nbLines));

        Renderer renderer = getRenderer(type.toString());
        String codeAsHtml = renderer.highlight(name, out.toString(), charset.name(), false);
        char[] charArray = codeAsHtml.toCharArray();
        handler.startDocument();
        handler.characters(charArray, 0, charArray.length);
        handler.endDocument();
      }
View Full Code Here

        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true)
          .toString()
          .replaceAll("\n", "<br />");
View Full Code Here

        }
        int lastDot = name.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = name.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(name, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n",
          "<br />");
      }
View Full Code Here

        }
        int lastDot = name.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = name.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(name, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n", "<br />");
      }
      catch (IOException e)
View Full Code Here

        }
        int lastDot = name.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = name.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(name, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n",
          "<br />");
      }
View Full Code Here

        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            renderer.highlight(source, resourceAsStream, output, "UTF-8", true);
            return output.toString("UTF-8");
          }
        }

        CharSequence escaped = Strings.escapeMarkup(IOUtils.toString(resourceAsStream),
View Full Code Here

        }
        int lastDot = name.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = name.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(name, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n", "<br />");
      }
      catch (IOException e)
View Full Code Here

        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        CharSequence escaped = Strings.escapeMarkup(sb.toString(), false, true);
        return Strings.replaceAll(escaped, "\n", "<br />").toString();
      }
View Full Code Here

TOP

Related Classes of com.uwyn.jhighlight.renderer.Renderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.