org.dbunit.dataset.xml
Class FlatDtdDataSet

java.lang.Object
  extended byorg.dbunit.dataset.AbstractDataSet
      extended byorg.dbunit.dataset.xml.FlatDtdDataSet
All Implemented Interfaces:
IDataSet, IDataSetConsumer

public class FlatDtdDataSet
extends AbstractDataSet
implements IDataSetConsumer

Since:
Apr 4, 2002
Version:
$Revision: 1.13 $
Author:
Manuel Laflamme

Constructor Summary
FlatDtdDataSet()
           
FlatDtdDataSet(IDataSetProducer producer)
           
FlatDtdDataSet(java.io.InputStream in)
           
FlatDtdDataSet(java.io.Reader reader)
           
 
Method Summary
protected  ITableIterator createIterator(boolean reversed)
           
 void endDataSet()
          Receive notification of the end of a dataset.
 void endTable()
          Receive notification of the end of a table.
 ITable getTable(java.lang.String tableName)
          Returns the specified table.
 ITableMetaData getTableMetaData(java.lang.String tableName)
          Returns the specified table metadata.
 java.lang.String[] getTableNames()
          Returns names of tables in this dataset in proper sequence.
 void row(java.lang.Object[] values)
          Receive notification of a table row.
 void startDataSet()
          Receive notification of the beginning of a dataset.
 void startTable(ITableMetaData metaData)
          Receive notification of the beginning of a table.
static void write(IDataSet dataSet, java.io.OutputStream out)
          Write the specified dataset to the specified output stream as DTD.
static void write(IDataSet dataSet, java.io.Writer out)
          Write the specified dataset to the specified writer as DTD.
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
cloneTables, getTables, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlatDtdDataSet

public FlatDtdDataSet()

FlatDtdDataSet

public FlatDtdDataSet(java.io.InputStream in)
               throws DataSetException,
                      java.io.IOException

FlatDtdDataSet

public FlatDtdDataSet(java.io.Reader reader)
               throws DataSetException,
                      java.io.IOException

FlatDtdDataSet

public FlatDtdDataSet(IDataSetProducer producer)
               throws DataSetException
Method Detail

write

public static void write(IDataSet dataSet,
                         java.io.OutputStream out)
                  throws java.io.IOException,
                         DataSetException
Write the specified dataset to the specified output stream as DTD.

Throws:
java.io.IOException
DataSetException

write

public static void write(IDataSet dataSet,
                         java.io.Writer out)
                  throws java.io.IOException,
                         DataSetException
Write the specified dataset to the specified writer as DTD.

Throws:
java.io.IOException
DataSetException

createIterator

protected ITableIterator createIterator(boolean reversed)
                                 throws DataSetException
Specified by:
createIterator in class AbstractDataSet
Throws:
DataSetException

getTableNames

public java.lang.String[] getTableNames()
                                 throws DataSetException
Description copied from interface: IDataSet
Returns names of tables in this dataset in proper sequence. Multiple occurence of the same name may be returned if multiple tables having the same name are present in the dataset.

Specified by:
getTableNames in interface IDataSet
Overrides:
getTableNames in class AbstractDataSet
Throws:
DataSetException

getTableMetaData

public ITableMetaData getTableMetaData(java.lang.String tableName)
                                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table metadata.

Specified by:
getTableMetaData in interface IDataSet
Overrides:
getTableMetaData in class AbstractDataSet
Throws:
DataSetException

getTable

public ITable getTable(java.lang.String tableName)
                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table.

Specified by:
getTable in interface IDataSet
Overrides:
getTable in class AbstractDataSet
Throws:
DataSetException

startDataSet

public void startDataSet()
                  throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the beginning of a dataset. This method is invoked only once, before any other methods in this interface.

Specified by:
startDataSet in interface IDataSetConsumer
Throws:
DataSetException

endDataSet

public void endDataSet()
                throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the end of a dataset. This method is invoked only once, and it will be the last method invoked in this interface.

Specified by:
endDataSet in interface IDataSetConsumer
Throws:
DataSetException

startTable

public void startTable(ITableMetaData metaData)
                throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the beginning of a table. This method is invoked at the beginning of every table in the dataset; there will be a corresponding IDataSetConsumer.endDataSet() event for every startTable event (even when the table is empty).

Specified by:
startTable in interface IDataSetConsumer
Parameters:
metaData - the table metadata
Throws:
DataSetException

endTable

public void endTable()
              throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the end of a table.

Specified by:
endTable in interface IDataSetConsumer
Throws:
DataSetException

row

public void row(java.lang.Object[] values)
         throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of a table row. This method is invoked to report each row of a table.

Specified by:
row in interface IDataSetConsumer
Parameters:
values - The row values.
Throws:
DataSetException


Copyright © 2002-2004 DbUnit.org. All Rights Reserved.