source.ucregents.playground.gui
Class Saver

java.lang.Object
  extended by source.ucregents.playground.gui.Saver

public class Saver
extends java.lang.Object

Designed to handle Saving and Loading in the game. Hopefully to be replaced with Castor (http://www.castor.org) as it handles the XML Parsing behind the scenes and auto-magically.


Constructor Summary
Saver(java.io.File readFrom)
          Constructor for loading an XML file
Saver(java.lang.String fileFrom)
           
Saver(java.util.Vector<BaseEntity> ents)
          Constructor for saving to the currently set XML file path
Saver(java.util.Vector<BaseEntity> ents, java.io.File saveTo)
          Constructor for serializing entities to an XML file.
 
Method Summary
 void createXMLDoc(java.util.Vector<BaseEntity> ents)
          Construct the XML document representing the Vector of entities in the editor
 void processWithDOM(java.lang.String urlString)
          Going to be used to parse out the XML in the Load process.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Saver

public Saver(java.io.File readFrom)
Constructor for loading an XML file

Parameters:
readFrom - XML File to read from

Saver

public Saver(java.lang.String fileFrom)

Saver

public Saver(java.util.Vector<BaseEntity> ents)
Constructor for saving to the currently set XML file path

Parameters:
ents - Entities to serialize into xml

Saver

public Saver(java.util.Vector<BaseEntity> ents,
             java.io.File saveTo)
Constructor for serializing entities to an XML file. Take a vector of entities and parse them into xml using their overridden toXMLElement() method

Parameters:
ents - Entities to serialize
saveTo - XML File to save to
Method Detail

createXMLDoc

public void createXMLDoc(java.util.Vector<BaseEntity> ents)
                  throws javax.xml.parsers.ParserConfigurationException
Construct the XML document representing the Vector of entities in the editor

Parameters:
ents - Entities to serialize
Throws:
javax.xml.parsers.ParserConfigurationException

processWithDOM

public void processWithDOM(java.lang.String urlString)
                    throws java.lang.Exception
Going to be used to parse out the XML in the Load process. Not implemented yet.

Parameters:
urlString - Path to XML to read from
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object