edu.umd.cs.jazz.io
Interface ZSerializable

All Known Subinterfaces:
ZLayoutManager
All Known Implementing Classes:
ZAnchorGroup, ZFadeGroup, ZGridLayoutManager, ZGroup, ZInvisibleGroup, ZLayerGroup, ZLayoutGroup, ZLeaf, ZNameGroup, ZNode, ZPathLayoutManager, ZProperty, ZSceneGraphObject, ZSelectionGroup, ZSpatialIndexGroup, ZTransformGroup, ZTreeLayoutManager, ZVisualComponent, ZVisualGroup, ZVisualLeaf

public interface ZSerializable

ZSerializable indicates that a class can be read/written with ZObjectOutputStream

If the object declares the ZSerializable writeReplace() method, then the object returned by writeReplace will be written out instead of this one. If writeReplace() is specified, and returns null, then this object is not written out at all.

If the object declares the ZSerializable readResolve() method, then the object returned by readResolve will be read in instead of this one. In this case, the setState of the new object will be called instead of the original one. The new object can just handle whatever subset of the original object's state as it wants - and ignore the rest. If readResolve() is specified, and returns null, then this object is not read in at all - and any references to this object will be replaced with null references.

Warning: Serialized and ZSerialized objects will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

Author:
Ben Bederson
, Britt McAlister

Method Summary
 void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
          Set some state of this object as it gets read back in.
 void writeObject(ZObjectOutputStream out)
          Write out all of this object's state.
 void writeObjectRecurse(ZObjectOutputStream out)
          Specify which objects this object references in order to write out the scenegraph properly
 

Method Detail

writeObject

public void writeObject(ZObjectOutputStream out)
                 throws java.io.IOException
Write out all of this object's state.

Parameters:
out - The stream that this object writes into
java.io.IOException

writeObjectRecurse

public void writeObjectRecurse(ZObjectOutputStream out)
                        throws java.io.IOException
Specify which objects this object references in order to write out the scenegraph properly

Parameters:
out - The stream that this object writes into
java.io.IOException

setState

public void setState(java.lang.String fieldType,
                     java.lang.String fieldName,
                     java.lang.Object fieldValue)
Set some state of this object as it gets read back in. After the object is created with its default no-arg constructor, this method will be called on the object once for each bit of state that was written out through calls to ZObjectOutputStream.writeState() within the writeObject method.

Parameters:
fieldType - The fully qualified type of the field
fieldName - The name of the field
fieldValue - The value of the field


Copyright 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.