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 Summary
Constructors Constructor Description LookaheadWikiPrinter(WikiPrinter printer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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 interfaceWikiPrinter
- Overrides:
print
in classWrappingWikiPrinter
- Parameters:
text
- print the providedString
.
-
println
public void println(String text)
- Specified by:
println
in interfaceWikiPrinter
- Overrides:
println
in classWrappingWikiPrinter
- Parameters:
text
- print the providedString
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
-
-