de.smartics.testdoc.core.adapter
Class PersistenceUtils

Package class diagram package PersistenceUtils
java.lang.Object
  extended by de.smartics.testdoc.core.adapter.PersistenceUtils

public final class PersistenceUtils
     
     
extends Object

Provides means to persist the state of collected test documentation information.

Author:
Robert Reiner

Constructor Summary
PersistenceUtils()
           
 
Method Summary
 Object deserialize(File file)
          Deserializes a single object from the given file.
 Object deserialize(FileObject file)
          Deserializes a single object from the given file.
 Object deserialize(InputStream in)
          Deserializes a single object from the given stream.
 void serialize(Object instance, FileObject file)
          Serializes the instance to the given file.
 void serialize(Object instance, OutputStream out)
          Serializes the index.
 void serialize(UnitTestDoc testDoc, File file)
          Serializes the test doc instance to the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceUtils

public PersistenceUtils()
Method Detail

serialize

public void serialize(Object instance,
                      OutputStream out)
               throws IllegalStateException
Serializes the index.

Parameters:
instance - the instance to serialize.
out - the stream to write to.
Throws:
IllegalStateException - if the index cannot be serialized.

serialize

public void serialize(Object instance,
                      FileObject file)
               throws IllegalStateException
Serializes the instance to the given file.

Parameters:
instance - the instance to serialize.
file - the file to write to.
Throws:
IllegalStateException - if the index cannot be serialized.

serialize

public void serialize(UnitTestDoc testDoc,
                      File file)
               throws IllegalStateException
Serializes the test doc instance to the given file.

Parameters:
testDoc - the instance to serialize.
file - the file to write to.
Throws:
IllegalStateException - if the index cannot be serialized.

deserialize

public Object deserialize(InputStream in)
Deserializes a single object from the given stream.

Parameters:
in - the stream to read from.
Returns:
the object read.

deserialize

public Object deserialize(File file)
Deserializes a single object from the given file.

Parameters:
file - the file to read from.
Returns:
the object read.

deserialize

public Object deserialize(FileObject file)
Deserializes a single object from the given file.

Parameters:
file - the file to read from.
Returns:
the object read.


Copyright © 2010-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.