Class LookaheadWikiPrinter

java.lang.Object
org.xwiki.rendering.renderer.printer.WrappingWikiPrinter
org.xwiki.rendering.renderer.printer.LookaheadWikiPrinter
All Implemented Interfaces:
WikiPrinter

public class LookaheadWikiPrinter extends WrappingWikiPrinter
Wiki printer that allows deferring printing text and that instead can save it in some internal buffer. This allows accumulating some content before it's flushed. This feature is used for example in the XWiki Syntax Renderer to accumulate text so that it be reviewed and escaped before printed (indeed some text has some characters that need to be escaped or they'd have a wiki meaning otherwise).
Since:
1.7
Version:
$Id: 782b20abbf121e905e63b58a221ee6a21bb2f9fe $
  • Constructor Details

    • LookaheadWikiPrinter

      public LookaheadWikiPrinter(WikiPrinter printer)
  • Method Details

    • printInternal

      protected void printInternal(String text)
    • printlnInternal

      protected void printlnInternal(String text)
    • print

      public void print(String text)
      Specified by:
      print in interface WikiPrinter
      Overrides:
      print in class WrappingWikiPrinter
      Parameters:
      text - print the provided String.
    • println

      public void println(String text)
      Specified by:
      println in interface WikiPrinter
      Overrides:
      println in class WrappingWikiPrinter
      Parameters:
      text - print the provided String and add a new line.
    • printDelayed

      public void printDelayed(String text)
    • printlnDelayed

      public void printlnDelayed(String text)
    • getBuffer

      public StringBuffer getBuffer()
    • flush

      public void flush()
    • getEOL

      protected String getEOL()
      This method is protected to allow classes extending this one to define what a new line is.
      Returns:
      a new line symbols