com.objectwave.persist.file
Class FileObjectFormatter

java.lang.Object
  |
  +--com.objectwave.utility.ObjectFormatter
        |
        +--com.objectwave.persist.ObjectFormatter
              |
              +--com.objectwave.persist.file.FileObjectFormatter

public class FileObjectFormatter
extends ObjectFormatter

Convert the data to a file friendly format. The big deal here is that 'null' objects will be represented as a string "NULL" in the file.

Version:
$Id: FileObjectFormatter.java,v 2.0 2001/06/11 16:00:04 dave_hoag Exp $
Author:
David Hoag

Nested Class Summary
 
Nested classes inherited from class com.objectwave.persist.ObjectFormatter
ObjectFormatter.Test
 
Field Summary
 
Fields inherited from class com.objectwave.utility.ObjectFormatter
Native_Array_Delimiter, outputStreams, zipBufferSize
 
Constructor Summary
FileObjectFormatter()
           
 
Method Summary
 java.lang.Object convertType(java.lang.Class c, java.lang.Object obj)
          Convert the object from its database representation to its actual value in the business object.
 void formatValue(java.lang.Object value, java.lang.StringBuffer buf)
          Don't use superfulous tick ' characters.
 
Methods inherited from class com.objectwave.persist.ObjectFormatter
bindBlob, convertArrays, convertType, convertTypes, needsArrayConversion
 
Methods inherited from class com.objectwave.utility.ObjectFormatter
bytesToString, convertArray, convertPrimitive, convertString, createArray, createNumber, createScalarType, formatDate, formatSerializable, formatValue, readSerializable, replace1QuoteWith2, serializeObject, stringToBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileObjectFormatter

public FileObjectFormatter()
Method Detail

convertType

public java.lang.Object convertType(java.lang.Class c,
                                    java.lang.Object obj)
Convert the object from its database representation to its actual value in the business object. This is the most likely method to be used in other processes. If the 'c' is a primtitive type, we force the value to zero.

Overrides:
convertType in class ObjectFormatter
Parameters:
c - Class to which the object is going to be converted.
obj - An unkown object type that may need to be converted to be a type of the class 'c'.
Returns:
An instance of the passed in type.

formatValue

public void formatValue(java.lang.Object value,
                        java.lang.StringBuffer buf)
                 throws java.io.IOException
Don't use superfulous tick ' characters. Substitute a string "NULL" for null values.

Overrides:
formatValue in class ObjectFormatter
Parameters:
value - The value to be added to the StringBuffer
buf - The buffer that will hold all of the object's data
Throws:
java.io.IOException