org.xwiki.rendering.renderer.printer
Class DefaultWikiPrinter

java.lang.Object
  extended by org.xwiki.rendering.renderer.printer.DefaultWikiPrinter
All Implemented Interfaces:
WikiPrinter

public class DefaultWikiPrinter
extends Object
implements WikiPrinter

Printer using a StringBuffer as the underlying output target.

Since:
1.6M1

Constructor Summary
DefaultWikiPrinter()
          The default constructor.
DefaultWikiPrinter(StringBuffer buffer)
           
 
Method Summary
 void clear()
          Removes the buffer's content which allows the printer to be reused.
 StringBuffer getBuffer()
           
protected  String getEOL()
          This method is protected to allow classes extending this one to override what a new line is.
 void print(String text)
           
 void println(String text)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultWikiPrinter

public DefaultWikiPrinter()
The default constructor. It initialize a new empty StringBuffer.


DefaultWikiPrinter

public DefaultWikiPrinter(StringBuffer buffer)
Parameters:
buffer - the StringBuffer to where to put the provided Strings.
Method Detail

getBuffer

public StringBuffer getBuffer()
Returns:
the buffer containing the printed Strings.

getEOL

protected String getEOL()
This method is protected to allow classes extending this one to override what a new line is.

Returns:
a new line symbols

print

public void print(String text)
Specified by:
print in interface WikiPrinter
Parameters:
text - print the provided String.

println

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

toString

public String toString()
Overrides:
toString in class Object

clear

public void clear()
Removes the buffer's content which allows the printer to be reused.