org.jcon.persistance
Class BarsoomWriter

java.lang.Object
  extended by org.jcon.persistance.BarsoomWriter
Direct Known Subclasses:
MetaBarsoomWriter

public class BarsoomWriter
extends java.lang.Object

A writer what serializes objects to Barsoom XML files. No relation to java.io.Writer.

Version:
1.0 6/13/2000
Author:
Paul Reavis

Field Summary
protected  boolean compactPrint
           
protected  int indention
           
protected  java.io.PrintWriter outie
           
protected  boolean outputReadOnlyFields
           
 
Constructor Summary
BarsoomWriter(java.io.OutputStream ostream)
          Creates a prettyprinting BarsoomWriter that writes to the given OutputStream.
BarsoomWriter(java.io.OutputStream ostream, LookupDatabase lookup)
          Creates a prettyprinting BarsoomWriter that writes to the given OutputStream.
BarsoomWriter(java.io.Writer writer)
          Creates a prettyprinting BarsoomWriter that writes to the given writer.
BarsoomWriter(java.io.Writer writer, LookupDatabase lookup)
          Creates a prettyprinting BarsoomWriter that writes to the given writer.
 
Method Summary
 void close()
          Closes the stream.
 void flush()
          Flushes the stream.
 boolean getOutputReadOnlyFields()
          If true, writer also outputs read-only fields from beans and records.
protected  void indent()
          Increases indention level by one.
 boolean isCompactPrinting()
          True if writer is compact printing.
protected  void newLine()
          Utility method; prints a newline and appropriate indention.
 void setCompactPrinting(boolean compactPrint)
          Turns compact printing on or off.
 void setOutputReadOnlyFields(boolean tizit)
           
protected  void undent()
          Decreases indention level by one.
protected  void writeArrayList(java.util.ArrayList victim, int refID)
           
protected  void writeBean(java.lang.Object victim, int refID)
           
protected  void writeCharacter(java.lang.Character carrie)
          Writes a single character.
protected  void writeClass(java.lang.Class victim)
           
protected  void writeComplexObject(java.lang.Object object)
          Defines a reference and a complex object.
protected  void writeMap(java.util.Map victim, int refID)
           
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 compactprint returns.
protected  void writeProperties(java.util.Map values)
           
protected  void writeProperties(java.util.Properties victim, int refID)
           
protected  void writeRecord(Record victim, int refID)
           
protected  void writeSet(java.util.Set victim, int refID)
           
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

compactPrint

protected boolean compactPrint

outie

protected java.io.PrintWriter outie

indention

protected int indention

outputReadOnlyFields

protected boolean outputReadOnlyFields
Constructor Detail

BarsoomWriter

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


BarsoomWriter

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

Throws:
java.io.IOException

BarsoomWriter

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


BarsoomWriter

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

Method Detail

setCompactPrinting

public void setCompactPrinting(boolean compactPrint)
Turns compact printing on or off.


isCompactPrinting

public boolean isCompactPrinting()
True if writer is compact printing.


getOutputReadOnlyFields

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


setOutputReadOnlyFields

public void setOutputReadOnlyFields(boolean tizit)

writeObject

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

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes 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 compactprint returns.

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,
                              int refID)
                       throws java.io.IOException
Throws:
java.io.IOException

writeSet

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

writeMap

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

writeProperties

protected void writeProperties(java.util.Properties victim,
                               int refID)
                        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,
                           int refID)
                    throws java.io.IOException
Throws:
java.io.IOException

writeBean

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

writeProperties

protected void writeProperties(java.util.Map values)
                        throws java.io.IOException
Throws:
java.io.IOException