apollo.dataadapter.gamexml
Class TransactionXMLAdapter

java.lang.Object
  extended by apollo.dataadapter.gamexml.TransactionXMLAdapter

public class TransactionXMLAdapter
extends java.lang.Object

This class is used to save and load Transaction objects into XML file.

Author:
wgm

Field Summary
static java.lang.String EXT_NAME
           
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
TransactionXMLAdapter()
          Default constructor.
 
Method Summary
static void loadTransactions(java.lang.String fileName, CurationSet curation, CurationState cs)
          Loads (new) transactions from a transaction file (transaction file name is derived from XML filename supplied to this method).
 void save(java.util.List transactions)
           
 void save(java.util.List transactions, boolean writingSeparateFile)
          Save a list of Transaction objects into a file.
 void setFileName(java.lang.String annotFileName)
           
 void setWriter(java.io.Writer writer)
          If writing to a game file GAMESave passes in the writer for the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

EXT_NAME

public static final java.lang.String EXT_NAME
See Also:
Constant Field Values
Constructor Detail

TransactionXMLAdapter

public TransactionXMLAdapter()
Default constructor.

Method Detail

setWriter

public void setWriter(java.io.Writer writer)
If writing to a game file GAMESave passes in the writer for the file


setFileName

public void setFileName(java.lang.String annotFileName)

loadTransactions

public static void loadTransactions(java.lang.String fileName,
                                    CurationSet curation,
                                    CurationState cs)
                             throws java.io.IOException
Loads (new) transactions from a transaction file (transaction file name is derived from XML filename supplied to this method). Needs to be static because it's called from static methods. Is this bad? sets curations transactions

Throws:
java.io.IOException

save

public void save(java.util.List transactions)
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save(java.util.List transactions,
                 boolean writingSeparateFile)
          throws java.io.IOException
Save a list of Transaction objects into a file.

Parameters:
transactions - a list of Transactions to be saved
writingSeparateFile - if true writes header & closes Writer when done
Throws:
java.io.IOException