org.dbunit.dataset.xml
Class XmlDataSet

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

public class XmlDataSet
extends CachedDataSet

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: 1043 $ $Date: 2009-09-24 03:26:51 -0500 (Thu, 24 Sep 2009) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Field Summary
 
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap
 
Constructor Summary
XmlDataSet(InputStream in)
          Creates an XmlDataSet with the specified xml input stream.
XmlDataSet(Reader reader)
          Creates an XmlDataSet with the specified xml reader.
 
Method Summary
static void write(IDataSet dataSet, OutputStream out)
          Write the specified dataset to the specified output stream as xml.
static void write(IDataSet dataSet, OutputStream out, String encoding)
          Write the specified dataset to the specified output stream as xml (using specified encoding).
static void write(IDataSet dataSet, Writer writer)
          Write the specified dataset to the specified writer as xml.
static void write(IDataSet dataSet, Writer writer, String encoding)
          Write the specified dataset to the specified writer as xml.
 
Methods inherited from class org.dbunit.dataset.CachedDataSet
createIterator, endDataSet, endTable, row, startDataSet, startTable
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, isCaseSensitiveTableNames, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XmlDataSet

public XmlDataSet(Reader reader)
           throws DataSetException
Creates an XmlDataSet with the specified xml reader.

Throws:
DataSetException

XmlDataSet

public XmlDataSet(InputStream in)
           throws DataSetException
Creates an XmlDataSet with the specified xml input stream.

Throws:
DataSetException
Method Detail

write

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

Throws:
IOException
DataSetException

write

public static void write(IDataSet dataSet,
                         OutputStream out,
                         String encoding)
                  throws IOException,
                         DataSetException
Write the specified dataset to the specified output stream as xml (using specified encoding).

Throws:
IOException
DataSetException

write

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

Throws:
IOException
DataSetException

write

public static void write(IDataSet dataSet,
                         Writer writer,
                         String encoding)
                  throws IOException,
                         DataSetException
Write the specified dataset to the specified writer as xml.

Throws:
IOException
DataSetException


Copyright © 2002-2012. All Rights Reserved.