org.jcon.persistance
Class UnserializingTOFObjectFactory

java.lang.Object
  extended by org.jcon.persistance.UnserializingTOFObjectFactory
All Implemented Interfaces:
TOFObjectFactory
Direct Known Subclasses:
MetaTOFObjectFactory

public class UnserializingTOFObjectFactory
extends java.lang.Object
implements TOFObjectFactory

This is the standard TOFObjectFactory implementation; it deserializes objects back to their original form.

Author:
Paul Reavis

Field Summary
static boolean fixPartnerSoft
           
 
Constructor Summary
UnserializingTOFObjectFactory()
           
UnserializingTOFObjectFactory(LookupDatabase lookup)
           
UnserializingTOFObjectFactory(LookupDatabase lookup, StructuredStore store, java.lang.String basePath)
           
 
Method Summary
 void addToArrayList(java.lang.Object vector, java.lang.Object item)
          Adds an item to a TOF ArrayList.
 void addToMap(java.lang.Object dictionary, java.lang.Object key, java.lang.Object value)
          Adds a mapping to a TOF dictionary.
 void addToSet(java.lang.Object set, java.lang.Object item)
          Adds an item to a TOF Set.
 java.lang.Object buildBooleanLiteral(boolean value)
          Returns an object corresponding to a boolean literal.
 java.lang.Object buildClassLiteral(java.lang.String name)
          Builds a class literal.
 java.lang.Object buildFloatLiteral(java.lang.String value)
          Builds a floating-point number from a text String.
 java.lang.Object buildIntegerLiteral(java.lang.String value)
          Builds an integer literal from a text String.
 java.lang.Object buildLookup(java.lang.Object classReference, java.lang.Object arg)
          Builds an object based on a lookup.
 java.lang.Object buildNullLiteral()
          Returns an object corresponding to the "null" literal.
 java.lang.Object createArrayList()
          Creates a new object corresponding to a TOF vector.
 java.lang.Object createBean(java.lang.Object classLiteral)
          Creates a new object corresponding to a TOF bean.
 java.lang.Object createMap()
          Creates a new object corresponding to a TOF dictionary.
 java.lang.Object createSet()
          Creates an object corresponding to a TOF set.
 void importClass(java.lang.Object classy)
          Imports a class so that only the classname need be used to reference it in the remainder of the file.
 java.lang.Object importObject(java.lang.Object path)
          Imports an object from another place in the store (invalid if store is null)
 java.lang.Object importTextObject(java.lang.Object path)
          Imports a text object from another place in the store (invalid if store is null)
 void setBeanState(java.lang.Object bean, java.lang.Object state)
          Populates a bean with properties.
 java.lang.Object swizzle(int referenceNumber)
          Converts an integer reference into the object referenced.
 void unswizzle(int referenceNumber, java.lang.Object victim)
          Defines an integer reference for an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fixPartnerSoft

public static boolean fixPartnerSoft
Constructor Detail

UnserializingTOFObjectFactory

public UnserializingTOFObjectFactory(LookupDatabase lookup)

UnserializingTOFObjectFactory

public UnserializingTOFObjectFactory(LookupDatabase lookup,
                                     StructuredStore store,
                                     java.lang.String basePath)

UnserializingTOFObjectFactory

public UnserializingTOFObjectFactory()
Method Detail

swizzle

public java.lang.Object swizzle(int referenceNumber)
                         throws TOFException
Converts an integer reference into the object referenced.

Specified by:
swizzle in interface TOFObjectFactory
Throws:
TOFException

unswizzle

public void unswizzle(int referenceNumber,
                      java.lang.Object victim)
               throws TOFException
Defines an integer reference for an object.

Specified by:
unswizzle in interface TOFObjectFactory
Throws:
TOFException

importClass

public void importClass(java.lang.Object classy)
                 throws TOFException
Imports a class so that only the classname need be used to reference it in the remainder of the file.

Specified by:
importClass in interface TOFObjectFactory
Throws:
TOFException

importObject

public java.lang.Object importObject(java.lang.Object path)
                              throws TOFException
Imports an object from another place in the store (invalid if store is null)

Specified by:
importObject in interface TOFObjectFactory
Throws:
TOFException

importTextObject

public java.lang.Object importTextObject(java.lang.Object path)
                                  throws TOFException
Imports a text object from another place in the store (invalid if store is null)

Specified by:
importTextObject in interface TOFObjectFactory
Throws:
TOFException

buildNullLiteral

public java.lang.Object buildNullLiteral()
                                  throws TOFException
Returns an object corresponding to the "null" literal.

Throws:
TOFException

buildBooleanLiteral

public java.lang.Object buildBooleanLiteral(boolean value)
                                     throws TOFException
Returns an object corresponding to a boolean literal.

Throws:
TOFException

buildLookup

public java.lang.Object buildLookup(java.lang.Object classReference,
                                    java.lang.Object arg)
                             throws TOFException
Builds an object based on a lookup.

Specified by:
buildLookup in interface TOFObjectFactory
Throws:
TOFException

buildFloatLiteral

public java.lang.Object buildFloatLiteral(java.lang.String value)
                                   throws TOFException
Builds a floating-point number from a text String.

Throws:
TOFException

buildIntegerLiteral

public java.lang.Object buildIntegerLiteral(java.lang.String value)
                                     throws TOFException
Builds an integer literal from a text String.

Throws:
TOFException

buildClassLiteral

public java.lang.Object buildClassLiteral(java.lang.String name)
                                   throws TOFException
Builds a class literal.

Specified by:
buildClassLiteral in interface TOFObjectFactory
Throws:
TOFException

createSet

public java.lang.Object createSet()
                           throws TOFException
Creates an object corresponding to a TOF set.

Specified by:
createSet in interface TOFObjectFactory
Throws:
TOFException

addToSet

public void addToSet(java.lang.Object set,
                     java.lang.Object item)
              throws TOFException
Adds an item to a TOF Set. The Set is the first argument.

Specified by:
addToSet in interface TOFObjectFactory
Throws:
TOFException

createArrayList

public java.lang.Object createArrayList()
                                 throws TOFException
Creates a new object corresponding to a TOF vector.

Specified by:
createArrayList in interface TOFObjectFactory
Throws:
TOFException

addToArrayList

public void addToArrayList(java.lang.Object vector,
                           java.lang.Object item)
                    throws TOFException
Adds an item to a TOF ArrayList. The vector is the first argument.

Specified by:
addToArrayList in interface TOFObjectFactory
Throws:
TOFException

createMap

public java.lang.Object createMap()
                           throws TOFException
Creates a new object corresponding to a TOF dictionary.

Specified by:
createMap in interface TOFObjectFactory
Throws:
TOFException

addToMap

public void addToMap(java.lang.Object dictionary,
                     java.lang.Object key,
                     java.lang.Object value)
              throws TOFException
Adds a mapping to a TOF dictionary.

Specified by:
addToMap in interface TOFObjectFactory
Throws:
TOFException

createBean

public java.lang.Object createBean(java.lang.Object classLiteral)
                            throws TOFException
Creates a new object corresponding to a TOF bean. The object is the class literal to use.

Specified by:
createBean in interface TOFObjectFactory
Throws:
TOFException

setBeanState

public void setBeanState(java.lang.Object bean,
                         java.lang.Object state)
                  throws TOFException
Populates a bean with properties.

Specified by:
setBeanState in interface TOFObjectFactory
Throws:
TOFException