Class XMLArchiver

java.lang.Object
common.xml.XMLArchiver
All Implemented Interfaces:
GuiXMLConstants

public class XMLArchiver extends Object implements GuiXMLConstants

Title: XML Archiver

Description: Used to save and load model information to be used for the simulation and for the save/load capability.

Author:
Bertoli Marco Date: 22-lug-2005 Time: 13.47.51
  • Field Details

    • XML_ARCHIVE_A_JMT_VERSION

      public static final String XML_ARCHIVE_A_JMT_VERSION
      Archive root attribute holding the JMT version that saved the file. Mirrored in legacyxml.LegacyXmlExporter.
      See Also:
  • Constructor Details

    • XMLArchiver

      public XMLArchiver()
  • Method Details

    • saveModel

      public static void saveModel(File archiveName, CommonModel model)
      Saves JMT Archive storing informations for simulator and for the gui
      Parameters:
      archiveName - Handler to the archive to be created
      model - data structure
    • loadModel

      public static void loadModel(File archiveName, CommonModel model)
      Loads an archive into specified CommonModel. If CommonModel is a JMODELModel, loads gui informations too.
      Parameters:
      archiveName - name of the archive to be opened
      model - CommonModel where all loaded informations should be stored Modified by Francesco D'Aquino
    • getDocument

      public static Document getDocument(CommonModel model, String documentName)
      Returns a new Archive XML Document used to store simulation and GUI data
      Parameters:
      model - data structure
      documentName - name of created document (to be set into root element)
      Returns:
      created Document
    • getSimFromArchiveDocument

      public static Element getSimFromArchiveDocument(Document archive)
      Returns a simulation data Element, given an input archive in Document format.
      Parameters:
      archive - Document of an archive
      Returns:
      Element of corresponding simulation data
    • getGuiFromArchiveDocument

      public static Element getGuiFromArchiveDocument(Document archive)
      Returns a Gui information data Element, given an input archive in Document format.
      Parameters:
      archive - Document of an archive
      Returns:
      Element of corresponding gui informations
    • getResultsFromArchiveDocument

      public static Element getResultsFromArchiveDocument(Document archive)
      Returns Results information data Element, given an input archive in Document format.
      Parameters:
      archive - Document of an archive
      Returns:
      Element of corresponding results informations