org.fosstrak.ale.util
Class SerializerUtil

java.lang.Object
  extended by org.fosstrak.ale.util.SerializerUtil

public class SerializerUtil
extends java.lang.Object

This class provides some methods to serialize ec specifications and reports.

Author:
regli, sawielan

Constructor Summary
SerializerUtil()
           
 
Method Summary
static void serializeAddReaders(AddReaders readers, java.lang.String pathName)
          Serializes an AddReaders to xml and stores this xml into a file.
static void serializeECReports(ECReports ecReports, java.io.Writer writer)
          This method serializes ec reports to an xml and writes it into a writer.
static void serializeECReportsPretty(ECReports ecReports, java.io.Writer writer)
          This method serializes ec reports to a well formed xml and writes it into a writer.
static void serializeECSpec(ECSpec ecSpec, java.io.FileOutputStream writer)
          This method serializes an ec specification to an xml and writes it into a writer.
static void serializeECSpec(ECSpec ecSpec, java.io.Writer writer)
          This method serializes en ECSpec to an xml and writes it into a writer.
static void serializeECSpecPretty(ECSpec ecSpec, java.io.FileOutputStream writer)
          This method serializes an ec specification to a well formed xml and writes it into a writer.
static void serializeLRSpec(LRSpec spec, java.lang.String pathName, boolean pretty)
          This method serializes an LRSpec to an xml and writes it into a file.
static void serializeLRSpec(LRSpec spec, java.io.Writer writer)
          This method serializes an LRSpec to an xml and writes it into a file.
static void serializeRemoveReaders(RemoveReaders readers, java.lang.String pathName)
          Serializes a RemoveReaders to xml and stores this xml into a file.
static void serializeSetProperties(SetProperties props, java.lang.String pathName)
          Serializes an SetProperties to xml and stores this xml into a file.
static void serializeSetReaders(SetReaders readers, java.lang.String pathName)
          Serializes a SetReaders to xml and stores this xml into a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializerUtil

public SerializerUtil()
Method Detail

serializeECSpec

public static void serializeECSpec(ECSpec ecSpec,
                                   java.io.FileOutputStream writer)
                            throws java.io.IOException
This method serializes an ec specification to an xml and writes it into a writer.

Parameters:
ecSpec - to serialize
writer - containing the xml
Throws:
java.io.IOException - if serialization fails

serializeECSpecPretty

public static void serializeECSpecPretty(ECSpec ecSpec,
                                         java.io.FileOutputStream writer)
                                  throws java.io.IOException
This method serializes an ec specification to a well formed xml and writes it into a writer.

Parameters:
ecSpec - to serialize
writer - to write the well formed xml into
Throws:
java.io.IOException - if serialization fails

serializeECReports

public static void serializeECReports(ECReports ecReports,
                                      java.io.Writer writer)
                               throws java.io.IOException
This method serializes ec reports to an xml and writes it into a writer.

Parameters:
ecReports - to serialize
writer - to write the xml into
Throws:
java.io.IOException - if serialization fails

serializeECReportsPretty

public static void serializeECReportsPretty(ECReports ecReports,
                                            java.io.Writer writer)
                                     throws java.io.IOException
This method serializes ec reports to a well formed xml and writes it into a writer.

Parameters:
ecReports - to serialize
writer - to write the well formed xml into
Throws:
java.io.IOException - if serialization fails

serializeLRSpec

public static void serializeLRSpec(LRSpec spec,
                                   java.lang.String pathName,
                                   boolean pretty)
                            throws java.io.IOException
This method serializes an LRSpec to an xml and writes it into a file.

Parameters:
spec - the LRSpec to be written into a file
pathName - the file where to store
pretty - flag whether well-formed xml or not
Throws:
java.io.IOException - whenever an io problem occurs

serializeLRSpec

public static void serializeLRSpec(LRSpec spec,
                                   java.io.Writer writer)
                            throws java.io.IOException
This method serializes an LRSpec to an xml and writes it into a file.

Parameters:
spec - the LRSpec to be written into a file
pathName - the file where to store
pretty - flag whether well-formed xml or not
Throws:
java.io.IOException - whenever an io problem occurs

serializeSetProperties

public static void serializeSetProperties(SetProperties props,
                                          java.lang.String pathName)
                                   throws java.io.IOException
Serializes an SetProperties to xml and stores this xml into a file.

Parameters:
props - the SetProperties to be serialized.
pathName - the path to the file where to store the xml.
Throws:
java.io.IOException - if the file cannot be used.

serializeRemoveReaders

public static void serializeRemoveReaders(RemoveReaders readers,
                                          java.lang.String pathName)
                                   throws java.io.IOException
Serializes a RemoveReaders to xml and stores this xml into a file.

Parameters:
readers - the RemoveReaders to be serialized.
pathName - the path to the file where to store the xml.
Throws:
java.io.IOException - if the file cannot be used.

serializeSetReaders

public static void serializeSetReaders(SetReaders readers,
                                       java.lang.String pathName)
                                throws java.io.IOException
Serializes a SetReaders to xml and stores this xml into a file.

Parameters:
readers - the SetReaders to be serialized.
pathName - the path to the file where to store the xml.
Throws:
java.io.IOException - if the file cannot be used.

serializeAddReaders

public static void serializeAddReaders(AddReaders readers,
                                       java.lang.String pathName)
                                throws java.io.IOException
Serializes an AddReaders to xml and stores this xml into a file.

Parameters:
readers - the AddReaders to be serialized.
pathName - the path to the file where to store the xml.
Throws:
java.io.IOException - if the file cannot be used.

serializeECSpec

public static void serializeECSpec(ECSpec ecSpec,
                                   java.io.Writer writer)
                            throws java.io.IOException
This method serializes en ECSpec to an xml and writes it into a writer.

Parameters:
ecSpec - spec to be serialized.
writer - to writer where to store.
Throws:
java.io.IOException - if the file cannot be read.


Copyright © 2009. All Rights Reserved.