Search this API

y.view
Interface GenericEdgeRealizer.UserDataHandler

All Known Implementing Classes:
SimpleUserDataHandler
Enclosing class:
GenericEdgeRealizer

public static interface GenericEdgeRealizer.UserDataHandler

This interface is used by GenericEdgeRealizer to delegate the copying and serialization/deserialization of any user-defined data to. Registered implementations of this interface will be used to perform the actual serialization and deserialization of the user-defined data object. Additionally, implementations are responsible for creating appropriate copies of the user-defined data.


Method Summary
 Object copyUserData(EdgeRealizer srcContext, Object srcData, EdgeRealizer targetContext)
          Copies the user-defined data appropriately.
 Object readUserData(EdgeRealizer context, ObjectInputStream ois)
          Retrieves the user-defined data object from the ObjectInputStream.
 void storeUserData(EdgeRealizer context, Object userData, ObjectOutputStream oos)
          Stores the user-defined data object to the ObjectOutputStream.
 

Method Detail

storeUserData

void storeUserData(EdgeRealizer context,
                   Object userData,
                   ObjectOutputStream oos)
                   throws IOException
Stores the user-defined data object to the ObjectOutputStream. Used for YGF serialization.

Throws:
IOException - if an exception occurs
Parameters:
context - the edge to store the user-defined data
userData - the user-defined data object
oos - the stream to store the user-defined data object to

readUserData

Object readUserData(EdgeRealizer context,
                    ObjectInputStream ois)
                    throws IOException
Retrieves the user-defined data object from the ObjectInputStream. Used for YGF deserialization.

Throws:
IOException - if an exception occurs
Parameters:
context - the edge to read the user-defined data for
ois - the stream to read the user-defined data object from
Returns:
the user-defined data object as read in from the stream

copyUserData

Object copyUserData(EdgeRealizer srcContext,
                    Object srcData,
                    EdgeRealizer targetContext)
Copies the user-defined data appropriately.

Parameters:
srcContext - the edge that will be copied
srcData - the data associated with the srcContext
targetContext - the edge the copy will be associated with
Returns:
the copy that will be stored with the targetContext

© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.