gizmoball.xmlparser
Class XMLParser

java.lang.Object
  extended by gizmoball.xmlparser.XMLParser

public class XMLParser
extends java.lang.Object

XMLParser is a factory class used to generate XML files from the current gizmoball game or load a new game from a given XML file


Method Summary
static WorldModel readXMLFile(java.io.FileInputStream f)
          Through a file chooser called through the GUI, this method loads XML files corresponding to gizmoball and returns a WorldModel corresponding to that file
static void writeXMLFile(WorldModel wm, java.io.FileOutputStream f)
          Creates the XML file from saving a game
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readXMLFile

public static WorldModel readXMLFile(java.io.FileInputStream f)
Through a file chooser called through the GUI, this method loads XML files corresponding to gizmoball and returns a WorldModel corresponding to that file

Requires:
f is a valid gizmoball XML file
Returns:
a WorldModel corresponding to f

writeXMLFile

public static void writeXMLFile(WorldModel wm,
                                java.io.FileOutputStream f)
Creates the XML file from saving a game

Requires:
wm is the current WorldModel containing all the information that is needed for saving f is a valid file to which the information should be saved to
Effects:
f contains the XML representation of wm