Parsing Engine

danbikel.switchboard
Class TextObjectWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by danbikel.switchboard.TextObjectWriter
All Implemented Interfaces:
ObjectWriter, Closeable, Flushable, Appendable

public class TextObjectWriter
extends PrintWriter
implements ObjectWriter

A simple ObjectWriter that merely prints out objects' string representations (as determined by their toString methods) to an underlying character stream (Writer) followed by a newline.

See Also:
TextObjectWriterFactory

Field Summary
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
TextObjectWriter(OutputStream os)
           
TextObjectWriter(OutputStream os, String encoding, int bufSize)
           
TextObjectWriter(String filename, String encoding, int bufSize, boolean append)
           
 
Method Summary
 void writeObject(Object obj)
          Writes the string representation of the specified object (as determined by its toString method) followed by a newline to the underlying Writer and flushes the stream.
 
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
 
Methods inherited from interface danbikel.switchboard.ObjectWriter
close
 

Constructor Detail

TextObjectWriter

public TextObjectWriter(OutputStream os)
                 throws IOException
Throws:
IOException

TextObjectWriter

public TextObjectWriter(OutputStream os,
                        String encoding,
                        int bufSize)
                 throws IOException
Throws:
IOException

TextObjectWriter

public TextObjectWriter(String filename,
                        String encoding,
                        int bufSize,
                        boolean append)
                 throws IOException
Throws:
IOException
Method Detail

writeObject

public void writeObject(Object obj)
                 throws IOException
Writes the string representation of the specified object (as determined by its toString method) followed by a newline to the underlying Writer and flushes the stream.

Specified by:
writeObject in interface ObjectWriter
Throws:
IOException - if the underlying Writer or output stream throws an IOException

Parsing Engine

Author: Dan Bikel.