Search this API

y.view
Interface YLabel.UserDataHandler

All Known Implementing Classes:
SimpleUserDataHandler
Enclosing class:
YLabel

public static interface YLabel.UserDataHandler

This interface is used during YGF serialization 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
 java.lang.Object copyUserData(YLabel srcContext, java.lang.Object srcData, YLabel targetContext)
          Copies the user-defined data appropriately.
 java.lang.Object readUserData(YLabel context, java.io.ObjectInputStream ois)
          Retrieves the user-defined data object from the ObjectInputStream.
 void storeUserData(YLabel context, java.lang.Object userData, java.io.ObjectOutputStream oos)
          Stores the user-defined data object to the ObjectOutputStream.
 

Method Detail

storeUserData

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

Parameters:
context - the label to store the user-defined data for
userData - the user-defined data object
oos - the stream to store the user-defined data object to
Throws:
java.io.IOException - if an exception occurs

readUserData

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

Parameters:
context - the label 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
Throws:
java.io.IOException - if an exception occurs

copyUserData

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

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

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