org.dbunit.dataset.xml
Class FlatDtdDataSet

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

public class FlatDtdDataSet
extends AbstractDataSet
implements IDataSetConsumer

Since:
1.0 (Apr 4, 2002)
Version:
$Revision: 877 $ $Date: 2008-11-15 11:03:44 +0100 (sab, 15 nov 2008) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Field Summary
 
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap
 
Constructor Summary
FlatDtdDataSet()
           
FlatDtdDataSet(IDataSetProducer producer)
           
FlatDtdDataSet(java.io.InputStream in)
           
FlatDtdDataSet(java.io.Reader reader)
           
 
Method Summary
protected  ITableIterator createIterator(boolean reversed)
          Creates an iterator which provides access to all tables of this dataset
 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.
 java.lang.String toString()
           
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
createTableNameMap, getTables, isCaseSensitiveTableNames, iterator, reverseIterator
 
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
Throws:
DataSetException
java.io.IOException

FlatDtdDataSet

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

FlatDtdDataSet

public FlatDtdDataSet(IDataSetProducer producer)
               throws DataSetException
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
See Also:
FlatDtdWriter

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
See Also:
FlatDtdWriter

createIterator

protected ITableIterator createIterator(boolean reversed)
                                 throws DataSetException
Description copied from class: AbstractDataSet
Creates an iterator which provides access to all tables of this dataset

Specified by:
createIterator in class AbstractDataSet
Parameters:
reversed - Whether the created iterator should be a reversed one or not
Returns:
The created ITableIterator
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 occurrence 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:
NoSuchTableException - if dataset do not contains the specified table
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:
NoSuchTableException - if dataset do not contains the specified table
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

toString

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


Copyright © 2002-2010. All Rights Reserved.