org.xwiki.rendering.internal.renderer.printer
Class WikiWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.xwiki.rendering.internal.renderer.printer.WikiWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class WikiWriter
extends Writer

Bridge so that WikiPrinter can be used in a tools supporting Writer api.


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
WikiWriter(WikiPrinter printer)
           
 
Method Summary
 void close()
           
 void flush()
           
 WikiPrinter getWikiPrinter()
           
 void setWikiPrinter(WikiPrinter printer)
           
 void write(char[] cbuf, int off, int len)
           
 void write(String str)
          
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiWriter

public WikiWriter(WikiPrinter printer)
Parameters:
printer - the actual printer
Method Detail

setWikiPrinter

public void setWikiPrinter(WikiPrinter printer)
Parameters:
printer - the actual printer

getWikiPrinter

public WikiPrinter getWikiPrinter()
Returns:
the actual printer

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Specified by:
write in class Writer
Throws:
IOException

write

public void write(String str)
           throws IOException

Override it to improve speed a little. Otherwise the String is transformed in char table passed to the over methods which recreate a String.

Overrides:
write in class Writer
Throws:
IOException