Class NeqSimXtream

java.lang.Object
neqsim.util.serialization.NeqSimXtream

public class NeqSimXtream extends Object
NeqSimXtream class for serializing and deserializing NeqSim objects.

Provides compressed XML serialization using XStream with ZIP compression. The resulting .neqsim files are compact and portable.

Features:

  • Automatic ThreadLocal field exclusion
  • ZIP compression for compact storage
  • Full object graph preservation with ID references
Version:
1.0
Author:
esol
  • Field Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
      Logger for this class.
  • Constructor Details

    • NeqSimXtream

      public NeqSimXtream()
  • Method Details

    • openNeqsim

      public static Object openNeqsim(String filename) throws IOException
      Opens and deserializes an object from a compressed .neqsim file.
      Parameters:
      filename - the path to the .neqsim file
      Returns:
      the deserialized object
      Throws:
      IOException - if the file cannot be read or is not a valid .neqsim file
      FileNotFoundException - if the file does not exist or process.xml is not found in ZIP
    • saveNeqsim

      public static boolean saveNeqsim(Object javaobject, String filename)
      Saves an object to a compressed .neqsim file.

      The object is serialized to XML using XStream and compressed using ZIP compression.

      Parameters:
      javaobject - the object to serialize (typically ProcessSystem or ProcessModel)
      filename - the path to save to (recommended extension: .neqsim)
      Returns:
      true if save was successful, false otherwise
    • createConfiguredXStream

      private static com.thoughtworks.xstream.XStream createConfiguredXStream()