org.dartra.standard.dao.ser
Class XStreamDataSource

java.lang.Object
  extended byorg.dartra.standard.dao.ser.SerDataSource
      extended byorg.dartra.standard.dao.ser.XStreamDataSource
All Implemented Interfaces:
org.dartra.framework.dao.DataSource

public class XStreamDataSource
extends SerDataSource

XStream data source. This data source accesses DarTra darts game data in an XML file that is read and written using the XStream XML serialisation library.

Author:
Erwin Vervaet

Constructor Summary
XStreamDataSource(java.lang.String fileName)
          Create a new XStream data source for named data file.
 
Method Summary
protected  DataContainer readData()
          Helper to read data from the data file.
 java.lang.String toString()
           
protected  void writeData(DataContainer data)
          Helper to write data to the data file.
 
Methods inherited from class org.dartra.standard.dao.ser.SerDataSource
exists, getConnection, getDataContainer, getFileName, load, reset, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XStreamDataSource

public XStreamDataSource(java.lang.String fileName)

Create a new XStream data source for named data file.

Method Detail

readData

protected DataContainer readData()
                          throws org.dartra.framework.dao.DataAccessException
Description copied from class: SerDataSource

Helper to read data from the data file.

Subclasses can redefine this method if they want to change the serialisation mechanism.

Overrides:
readData in class SerDataSource
Throws:
org.dartra.framework.dao.DataAccessException

writeData

protected void writeData(DataContainer data)
                  throws org.dartra.framework.dao.DataAccessException
Description copied from class: SerDataSource

Helper to write data to the data file.

Subclasses can redefine this method if they want to change the serialisation mechanism.

Overrides:
writeData in class SerDataSource
Throws:
org.dartra.framework.dao.DataAccessException

toString

public java.lang.String toString()
Overrides:
toString in class SerDataSource