feynman.framework.simulation
Class Marshaller
java.lang.Object
|
+--feynman.framework.simulation.Marshaller
- public class Marshaller
- extends java.lang.Object
Utility class to load the properties file that the user has defined. If
there is a switch to an XML format and using a real Marshalling/Unmarshalling
tool like Castor, then this class can easily be refactored to an adaptor class.
The constructor is private since this is a utility class so there is no instance
of this class to create or get. To use this class treat it just like the Math
utility class in the following manner:
Simulation simulation = Marshaller.unmarshall("Simulation.properties");
- Version:
- $Revision: 1.1.1.1 $ $Date: 2002/11/12 02:25:41 $
- Author:
- Wes Bailey
Method Summary |
static void |
marshall(Simulation sim,
java.lang.String outfile)
Method to save a serialized version of the simulation object. |
static Simulation |
unmarshall(java.lang.String infile)
Method to create a simulation object with attribute values specified by the
properties file description of the object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
marshall
public static void marshall(Simulation sim,
java.lang.String outfile)
throws MarshallingException
- Method to save a serialized version of the simulation object.
- Parameters:
sim
- The simulation bean to serialize.outfile
- The file to save the contents of the bean to.
unmarshall
public static Simulation unmarshall(java.lang.String infile)
throws MarshallingException
- Method to create a simulation object with attribute values specified by the
properties file description of the object.
- Parameters:
infile
- The name of the properties file to parse and create the bean from.