org.dbunit.dataset.xml
Class FlatXmlWriter

java.lang.Object
  extended by org.dbunit.dataset.xml.FlatXmlWriter
All Implemented Interfaces:
IDataSetConsumer

public class FlatXmlWriter
extends Object
implements IDataSetConsumer

Since:
1.5.5 (Apr 19, 2003)
Version:
$Revision: 859 $ $Date: 2008-11-02 12:50:23 +0100 (Sun, 02 Nov 2008) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Constructor Summary
FlatXmlWriter(OutputStream out)
           
FlatXmlWriter(OutputStream outputStream, String encoding)
           
FlatXmlWriter(Writer writer)
           
FlatXmlWriter(Writer writer, String encoding)
           
 
Method Summary
 void endDataSet()
          Receive notification of the end of a dataset.
 void endTable()
          Receive notification of the end of a table.
 void row(Object[] values)
          Receive notification of a table row.
 void setDocType(String systemId)
           
 void setIncludeEmptyTable(boolean includeEmptyTable)
           
 void setPrettyPrint(boolean enabled)
          Enable or disable pretty print of the XML.
 void startDataSet()
          Receive notification of the beginning of a dataset.
 void startTable(ITableMetaData metaData)
          Receive notification of the beginning of a table.
 void write(IDataSet dataSet)
          Writes the given IDataSet using this writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlatXmlWriter

public FlatXmlWriter(OutputStream out)
              throws IOException
Throws:
IOException

FlatXmlWriter

public FlatXmlWriter(OutputStream outputStream,
                     String encoding)
              throws UnsupportedEncodingException
Parameters:
outputStream - The stream to which the XML will be written.
encoding - The encoding to be used for the XmlWriter. Can be null. See XmlWriter.XmlWriter(OutputStream, String).
Throws:
UnsupportedEncodingException

FlatXmlWriter

public FlatXmlWriter(Writer writer)

FlatXmlWriter

public FlatXmlWriter(Writer writer,
                     String encoding)
Method Detail

setIncludeEmptyTable

public void setIncludeEmptyTable(boolean includeEmptyTable)

setDocType

public void setDocType(String systemId)

setPrettyPrint

public void setPrettyPrint(boolean enabled)
Enable or disable pretty print of the XML.

Parameters:
enabled - true to enable pretty print (which is the default). false otherwise.
Since:
2.4

write

public void write(IDataSet dataSet)
           throws DataSetException
Writes the given IDataSet using this writer.

Parameters:
dataSet - The IDataSet to be written
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(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-2012. All Rights Reserved.