public class SaveAndRestoreextends ObjectProvides static methods for saving Exhibits and their associated Views to an XML file and for restoring an Exhbit and Views from such a file. (Methods in this class can also be used for encoding/decoding exhibits to XML Docment objects without ever writing them to a file.) There are also a few stating utility routines that can help programmers write Exhbit, View, and Decoration classes in a way that will work with this Save/Restore facility.
When Views and Exhibits are stored in XML format by this class their parameters are saved automatically. Decorations whose classes are marked with a
VMMSaveare saved automatically. Property variables in Views, Exhibits, and Decorations that are marked with a
VMMSaveannotation are saved automatically. Saving other data of a View, Exhibit, or Decoration class is the responsibility of that class. Parameters, properties, and decorations are restored automatically when the file is read. The Exhibit, View, and Decoration classes include an
addExtraXMLmethod that can be overridden to write any necessary extra data that is not saved automatically and a
readExtraXMLmethod for restoring the data when the file is read.
Note that for property variables, only properties of certain types are supported by these methods. For data other than supported properties, the programmer should write an XML representation of the data in
writeExtraXMLand should read this data in the
readExtraXMLmethod in the same class.
This class is meant to work with well-formed XML, but does not require valid XML (that is, there is no DTD or XML schema to specify the syntax).