org.identityconnectors.common
Class StringPrintWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by org.identityconnectors.common.StringPrintWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class StringPrintWriter
extends PrintWriter

Simple extension of PrintWriter so you don't have to create a StringWriter to pass to it, when you want the functionality of PrintWriter but you want it in a buffer.


Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
StringPrintWriter()
          Create with the default initial size.
StringPrintWriter(int initSize)
          Create with an initialize size with the parameter supplied..
 
Method Summary
 void clear()
          Clear out the underlying string writer.
 Reader getReader()
          Return a reader for the accumulated string.
 String getString()
          Return the string in the internal string writer.
 void print(String[] value)
          Call print for every string in the array.
 void println(String[] value)
          Call println for every string in the array.
 
Methods inherited from class java.io.PrintWriter
append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringPrintWriter

public StringPrintWriter()
Create with the default initial size.


StringPrintWriter

public StringPrintWriter(int initSize)
Create with an initialize size with the parameter supplied..

Method Detail

getString

public String getString()
Return the string in the internal string writer.


getReader

public Reader getReader()
Return a reader for the accumulated string.


println

public void println(String[] value)
Call println for every string in the array.


print

public void print(String[] value)
Call print for every string in the array.

Throws:
NullPointerException - iff value is null.

clear

public void clear()
Clear out the underlying string writer.



Copyright © 2012. All Rights Reserved.