public class SerializationContext
extends java.lang.Object
Schedule
elements to and from a binary stream or XML document.Constructor and Description |
---|
SerializationContext(Schedule schedule)
Initializes a new instance of the
SerializationContext class. |
Modifier and Type | Method and Description |
---|---|
void |
addSerializationContextListener(SerializationContextListener listener)
Adds a
SerializationContextListener to the context. |
int |
getFileVersion()
Gets the format revision number of the file being loaded.
|
Schedule |
getSchedule()
Gets a reference to the schedule currently being serialized or deserialized.
|
void |
removeSerializationContextListener(SerializationContextListener listener)
Removes the specified
SerializationContextListener from the context. |
public SerializationContext(Schedule schedule)
SerializationContext
class.
Generally, you do not have to instantiate from SerializationContext
explicitly
unless you want to serialize only particular elements and not the entire schedule.
schedule
- An instance of the Schedule
class representing
the schedule to associate with.public int getFileVersion()
This revision number specifies the format of the schedule binary and XML files,
but not of distinct item classes. If using custom item classes, specify their
format revision number when registering them with the schedule via the
Schedule.registerItemClass(java.lang.Class<? extends com.mindfusion.scheduling.model.Item>, java.lang.String, int)
method.
public Schedule getSchedule()
Schedule
class.public void addSerializationContextListener(SerializationContextListener listener)
SerializationContextListener
to the context.listener
- The SerializationContextListener
to be added.public void removeSerializationContextListener(SerializationContextListener listener)
SerializationContextListener
from the context.listener
- The listener to be removed.