org.xwiki.rendering.renderer.printer
Class LookaheadWikiPrinter

java.lang.Object
  extended by org.xwiki.rendering.renderer.printer.WrappingWikiPrinter
      extended by 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: 457ee6f2f2ad4a9ce1cc6fab822f0cc42afe53db $

Constructor Summary
LookaheadWikiPrinter(WikiPrinter printer)
           
 
Method Summary
 void flush()
           
 StringBuffer getBuffer()
           
protected  String getEOL()
          This method is protected to allow classes extending this one to define what a new line is.
 void print(String text)
           
 void printDelayed(String text)
           
protected  void printInternal(String text)
           
 void println(String text)
           
 void printlnDelayed(String text)
           
protected  void printlnInternal(String text)
           
 
Methods inherited from class org.xwiki.rendering.renderer.printer.WrappingWikiPrinter
getWrappedPrinter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LookaheadWikiPrinter

public LookaheadWikiPrinter(WikiPrinter printer)
Method Detail

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


Copyright © 2004-2011 XWiki. All Rights Reserved.