Package org.dbunit.dataset.xml
Class XmlDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.CachedDataSet
org.dbunit.dataset.xml.XmlDataSet
- All Implemented Interfaces:
IDataSet,IDataSetConsumer
Reads and writes original XML dataset document. This format
is very verbose and must conform to the following DTD:
<?xml version="1.0" encoding="UTF-8"?> <!ELEMENT dataset (table+)> <!ELEMENT table (column*, row*)> <!ATTLIST table name CDATA #REQUIRED> <!ELEMENT column (#PCDATA)> <!ELEMENT row (value | null | none)*> <!ELEMENT value (#PCDATA)> <!ELEMENT null EMPTY> <!ELEMENT none EMPTY>
- Since:
- 1.0 (Feb 17, 2002)
- Version:
- $Revision$ $Date$
- Author:
- Manuel Laflamme, Last changed by: $Author$
-
Field Summary
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap -
Constructor Summary
ConstructorsConstructorDescriptionCreates an XmlDataSet with the specified xml input stream.XmlDataSet(Reader reader) Creates an XmlDataSet with the specified xml reader. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidwrite(IDataSet dataSet, OutputStream out) Write the specified dataset to the specified output stream as xml.static voidwrite(IDataSet dataSet, OutputStream out, Charset charset) Write the specified dataset to the specified output stream as xml (using specified encoding).static voidWrite the specified dataset to the specified writer as xml.static voidWrite the specified dataset to the specified writer as xml.Methods inherited from class org.dbunit.dataset.CachedDataSet
createIterator, endDataSet, endTable, row, startDataSet, startTableMethods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, initialize, isCaseSensitiveTableNames, iterator, reverseIterator, toString
-
Constructor Details
-
XmlDataSet
Creates an XmlDataSet with the specified xml reader.- Throws:
DataSetException
-
XmlDataSet
Creates an XmlDataSet with the specified xml input stream.- Throws:
DataSetException
-
-
Method Details
-
write
Write the specified dataset to the specified output stream as xml.- Throws:
IOExceptionDataSetException
-
write
public static void write(IDataSet dataSet, OutputStream out, Charset charset) throws IOException, DataSetException Write the specified dataset to the specified output stream as xml (using specified encoding).- Throws:
IOExceptionDataSetException
-
write
Write the specified dataset to the specified writer as xml.- Throws:
IOExceptionDataSetException
-
write
public static void write(IDataSet dataSet, Writer writer, Charset charset) throws IOException, DataSetException Write the specified dataset to the specified writer as xml.- Throws:
IOExceptionDataSetException
-