org.jcon.persistance
Class TOFWriter

java.lang.Object
  extended by org.jcon.persistance.TOFWriter
Direct Known Subclasses:
MetaTOFWriter

public class TOFWriter
extends java.lang.Object

A writer what writes TOF files. No relation to java.io.Writer.

Version:
1.0 9/14/97
Author:
Paul Reavis

Field Summary
protected  int indention
           
protected  LookupDatabase lookup
           
protected  boolean noPointers
           
protected  java.io.PrintWriter outie
           
protected  boolean outputReadOnlyFields
           
protected  boolean prettyPrint
           
protected  ReferenceMap references
           
 
Constructor Summary
TOFWriter(java.io.OutputStream ostream)
          Creates a prettyprinting TOFWriter that writes to the given OutputStream.
TOFWriter(java.io.OutputStream ostream, LookupDatabase lookup)
          Creates a prettyprinting TOFWriter that writes to the given OutputStream.
TOFWriter(java.io.Writer writer)
          Creates a prettyprinting TOFWriter that writes to the given writer.
TOFWriter(java.io.Writer writer, LookupDatabase lookup)
          Creates a prettyprinting TOFWriter that writes to the given writer.
 
Method Summary
 void close()
          Closes the stream.
 boolean getNoPointers()
           
 boolean getOutputReadOnlyFields()
          If true, writer also outputs read-only fields from beans and records.
protected  void indent()
          Increases indention level by one.
 boolean isPrettyPrinting()
          True if writer is prettyprinting.
protected  void newLine()
          Utility method; prints a newline and appropriate indention.
 void setNoPointers(boolean tizit)
           
 void setOutputReadOnlyFields(boolean tizit)
           
 void setPrettyPrinting(boolean prettyPrint)
          Turns prettyprinting on or off.
protected  void undent()
          Decreases indention level by one.
protected  void writeArrayList(java.util.ArrayList victim)
           
protected  void writeBean(java.lang.Object victim)
           
protected  void writeCharacter(java.lang.Character carrie)
          Writes a single character.
protected  void writeClass(java.lang.Class victim)
           
protected  void writeCog(Cog cog)
           
protected  void writeComplexObject(java.lang.Object object)
          Defines a reference and a complex object.
protected  void writeLookup(java.lang.Object object)
          Writes a lookup reference to an object.
protected  void writeMap(java.util.Map victim)
           
protected  void writeNumber(java.lang.Number numb)
          Writes a Number.
 void writeObject(java.lang.Object object)
          Writes an object to the stream.
protected  void writeObjectImpl(java.lang.Object object)
          Writes an object without any prettyprint returns.
protected  void writeRecord(Record victim)
           
protected  void writeSet(java.util.Set victim)
           
protected  void writeString(java.lang.String stringy)
          Writes a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prettyPrint

protected boolean prettyPrint

outie

protected java.io.PrintWriter outie

indention

protected int indention

references

protected ReferenceMap references

lookup

protected LookupDatabase lookup

outputReadOnlyFields

protected boolean outputReadOnlyFields

noPointers

protected boolean noPointers
Constructor Detail

TOFWriter

public TOFWriter(java.io.Writer writer)
Creates a prettyprinting TOFWriter that writes to the given writer.


TOFWriter

public TOFWriter(java.io.OutputStream ostream)
Creates a prettyprinting TOFWriter that writes to the given OutputStream.


TOFWriter

public TOFWriter(java.io.Writer writer,
                 LookupDatabase lookup)
Creates a prettyprinting TOFWriter that writes to the given writer.


TOFWriter

public TOFWriter(java.io.OutputStream ostream,
                 LookupDatabase lookup)
Creates a prettyprinting TOFWriter that writes to the given OutputStream.

Method Detail

setPrettyPrinting

public void setPrettyPrinting(boolean prettyPrint)
Turns prettyprinting on or off.


isPrettyPrinting

public boolean isPrettyPrinting()
True if writer is prettyprinting.


getOutputReadOnlyFields

public boolean getOutputReadOnlyFields()
If true, writer also outputs read-only fields from beans and records.


setOutputReadOnlyFields

public void setOutputReadOnlyFields(boolean tizit)

getNoPointers

public boolean getNoPointers()

setNoPointers

public void setNoPointers(boolean tizit)

writeObject

public void writeObject(java.lang.Object object)
                 throws java.io.IOException
Writes an object to the stream.

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the stream.

Throws:
java.io.IOException

writeObjectImpl

protected void writeObjectImpl(java.lang.Object object)
                        throws java.io.IOException
Writes an object without any prettyprint returns.

Throws:
java.io.IOException

writeCog

protected void writeCog(Cog cog)
                 throws java.io.IOException
Throws:
java.io.IOException

writeLookup

protected void writeLookup(java.lang.Object object)
                    throws java.io.IOException
Writes a lookup reference to an object.

Throws:
java.io.IOException

writeComplexObject

protected void writeComplexObject(java.lang.Object object)
                           throws java.io.IOException
Defines a reference and a complex object.

Throws:
java.io.IOException

newLine

protected void newLine()
Utility method; prints a newline and appropriate indention.


indent

protected void indent()
Increases indention level by one.


undent

protected void undent()
Decreases indention level by one.


writeCharacter

protected void writeCharacter(java.lang.Character carrie)
                       throws java.io.IOException
Writes a single character.

Throws:
java.io.IOException

writeNumber

protected void writeNumber(java.lang.Number numb)
                    throws java.io.IOException
Writes a Number.

Throws:
java.io.IOException

writeString

protected void writeString(java.lang.String stringy)
                    throws java.io.IOException
Writes a String.

Throws:
java.io.IOException

writeArrayList

protected void writeArrayList(java.util.ArrayList victim)
                       throws java.io.IOException
Throws:
java.io.IOException

writeSet

protected void writeSet(java.util.Set victim)
                 throws java.io.IOException
Throws:
java.io.IOException

writeMap

protected void writeMap(java.util.Map victim)
                 throws java.io.IOException
Throws:
java.io.IOException

writeClass

protected void writeClass(java.lang.Class victim)
                   throws java.io.IOException
Throws:
java.io.IOException

writeRecord

protected void writeRecord(Record victim)
                    throws java.io.IOException
Throws:
java.io.IOException

writeBean

protected void writeBean(java.lang.Object victim)
                  throws java.io.IOException
Throws:
java.io.IOException