Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

feynman.framework.simulation
Class Marshaller  view Marshaller download Marshaller.java

java.lang.Object
  extended byfeynman.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 $

Field Summary
private static java.io.File file
           
private static java.io.FileInputStream fin
           
private static java.io.FileWriter fw
           
private static java.util.Properties props
           
private static java.io.PrintWriter pw
           
 
Constructor Summary
private Marshaller()
          This is a utility class so there is no instance of the class to be created or retrieved.
 
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 descriptoin of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private static java.io.File file

fw

private static java.io.FileWriter fw

fin

private static java.io.FileInputStream fin

pw

private static java.io.PrintWriter pw

props

private static java.util.Properties props
Constructor Detail

Marshaller

private Marshaller()
This is a utility class so there is no instance of the class to be created or retrieved.

Method Detail

marshall

public static void marshall(Simulation sim,
                            java.lang.String outfile)
                     throws MarshallingException
Method to save a serialized version of the simulation object.


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 descriptoin of the object.