|
|||||||||
| Home >> All >> org >> dbunit >> dataset >> [ xml overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.dbunit.dataset.xml
Class FlatXmlDataSet

java.lang.Objectorg.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.CachedDataSet
org.dbunit.dataset.xml.FlatXmlDataSet
- All Implemented Interfaces:
- org.dbunit.dataset.IDataSet, org.dbunit.dataset.stream.IDataSetConsumer
- public class FlatXmlDataSet
- extends org.dbunit.dataset.CachedDataSet
Reads and writes flat XML dataset document. Each XML element corresponds to a table row. Each XML element name corresponds to a table name. The XML attributes correspond to table columns.
Flat XML dataset document sample:
<!DOCTYPE dataset SYSTEM "my-dataset.dtd">
<dataset>
<TEST_TABLE COL0="row 0 col 0"
COL1="row 0 col 1"
COL2="row 0 col 2"/>
<TEST_TABLE COL1="row 1 col 1"/>
<SECOND_TABLE COL0="row 0 col 0"
COL1="row 0 col 1" />
<EMPTY_TABLE/>
</dataset>
To specify null values, omit corresponding attribute. In the above example, missing COL0 and COL2 attributes of TEST_TABLE second row represents null values.
Table metadata is deduced from the first row of each table. Beware that DbUnit may think a table miss some columns if the first row of that table has one or more null values. Because of that, this is highly recommended to use DTD. DbUnit will use the columns declared in the DTD as table metadata. DbUnit only support external system URI. The URI can be absolute or relative.
- Since:
- Mar 12, 2002
- Version:
- $Revision: 1.29 $
| Field Summary |
| Fields inherited from class org.dbunit.dataset.CachedDataSet |
|
| Constructor Summary | |
FlatXmlDataSet(java.io.File xmlFile)
Creates an FlatXmlDataSet object with the specifed xml file. |
|
FlatXmlDataSet(java.io.File xmlFile,
boolean dtdMetadata)
Creates an FlatXmlDataSet object with the specifed xml file. |
|
FlatXmlDataSet(org.xml.sax.InputSource source)
Creates an FlatXmlDataSet object with the specifed InputSource. |
|
FlatXmlDataSet(java.io.InputStream xmlStream)
Creates an FlatXmlDataSet object with the specifed xml input stream. |
|
FlatXmlDataSet(java.io.InputStream xmlStream,
boolean dtdMetadata)
Creates an FlatXmlDataSet object with the specifed xml input stream. |
|
FlatXmlDataSet(java.io.InputStream xmlStream,
org.dbunit.dataset.IDataSet metaDataSet)
Creates an FlatXmlDataSet object with the specifed xml input stream. |
|
FlatXmlDataSet(java.io.InputStream xmlStream,
java.io.InputStream dtdStream)
Creates an FlatXmlDataSet object with the specifed xml and dtd input stream. |
|
FlatXmlDataSet(java.io.Reader xmlReader)
Creates an FlatXmlDataSet object with the specifed xml reader. |
|
FlatXmlDataSet(java.io.Reader xmlReader,
boolean dtdMetadata)
Creates an FlatXmlDataSet object with the specifed xml reader. |
|
FlatXmlDataSet(java.io.Reader xmlReader,
org.dbunit.dataset.IDataSet metaDataSet)
Creates an FlatXmlDataSet object with the specifed xml reader. |
|
FlatXmlDataSet(java.io.Reader xmlReader,
java.io.Reader dtdReader)
Creates an FlatXmlDataSet object with the specifed xml and dtd readers. |
|
FlatXmlDataSet(java.net.URL xmlUrl)
Creates an FlatXmlDataSet object with the specifed xml URL. |
|
FlatXmlDataSet(java.net.URL xmlUrl,
boolean dtdMetadata)
Creates an FlatXmlDataSet object with the specifed xml URL. |
|
| Method Summary | |
static void |
write(org.dbunit.dataset.IDataSet dataSet,
java.io.OutputStream out)
Write the specified dataset to the specified output stream as xml. |
static void |
write(org.dbunit.dataset.IDataSet dataSet,
java.io.Writer writer)
Write the specified dataset to the specified writer as xml. |
static void |
write(org.dbunit.dataset.IDataSet dataSet,
java.io.Writer writer,
java.lang.String encoding)
Write the specified dataset to the specified writer as xml. |
static void |
writeDtd(org.dbunit.dataset.IDataSet dataSet,
java.io.OutputStream out)
Deprecated. use FlatDtdDataSet.write(org.dbunit.dataset.IDataSet, java.io.OutputStream) 55 |
| Methods inherited from class org.dbunit.dataset.CachedDataSet |
createIterator, endDataSet, endTable, row, startDataSet, startTable |
| Methods inherited from class org.dbunit.dataset.AbstractDataSet |
cloneTables, getTable, getTableMetaData, getTableNames, getTables, iterator, reverseIterator, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
FlatXmlDataSet
public FlatXmlDataSet(org.xml.sax.InputSource source) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed InputSource.
FlatXmlDataSet
public FlatXmlDataSet(java.io.File xmlFile) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml file.
Relative DOCTYPE uri are resolved from the xml file path.
FlatXmlDataSet
public FlatXmlDataSet(java.io.File xmlFile, boolean dtdMetadata) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml file.
Relative DOCTYPE uri are resolved from the xml file path.
FlatXmlDataSet
public FlatXmlDataSet(java.net.URL xmlUrl) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml URL.
Relative DOCTYPE uri are resolved from the xml file path.
FlatXmlDataSet
public FlatXmlDataSet(java.net.URL xmlUrl, boolean dtdMetadata) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml URL.
Relative DOCTYPE uri are resolved from the xml file path.
FlatXmlDataSet
public FlatXmlDataSet(java.io.Reader xmlReader) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml reader.
Relative DOCTYPE uri are resolved from the current working dicrectory.
FlatXmlDataSet
public FlatXmlDataSet(java.io.Reader xmlReader, boolean dtdMetadata) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml reader.
Relative DOCTYPE uri are resolved from the current working dicrectory.
FlatXmlDataSet
public FlatXmlDataSet(java.io.Reader xmlReader, java.io.Reader dtdReader) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml and dtd readers.
FlatXmlDataSet
public FlatXmlDataSet(java.io.Reader xmlReader, org.dbunit.dataset.IDataSet metaDataSet) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml reader.
FlatXmlDataSet
public FlatXmlDataSet(java.io.InputStream xmlStream) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml input stream.
Relative DOCTYPE uri are resolved from the current working dicrectory.
FlatXmlDataSet
public FlatXmlDataSet(java.io.InputStream xmlStream, boolean dtdMetadata) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml input stream.
Relative DOCTYPE uri are resolved from the current working dicrectory.
FlatXmlDataSet
public FlatXmlDataSet(java.io.InputStream xmlStream, java.io.InputStream dtdStream) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml and dtd input
stream.
FlatXmlDataSet
public FlatXmlDataSet(java.io.InputStream xmlStream, org.dbunit.dataset.IDataSet metaDataSet) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Creates an FlatXmlDataSet object with the specifed xml input stream.
| Method Detail |
write
public static void write(org.dbunit.dataset.IDataSet dataSet, java.io.OutputStream out) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Write the specified dataset to the specified output stream as xml.
write
public static void write(org.dbunit.dataset.IDataSet dataSet, java.io.Writer writer) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Write the specified dataset to the specified writer as xml.
write
public static void write(org.dbunit.dataset.IDataSet dataSet, java.io.Writer writer, java.lang.String encoding) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Write the specified dataset to the specified writer as xml.
writeDtd
public static void writeDtd(org.dbunit.dataset.IDataSet dataSet, java.io.OutputStream out) throws java.io.IOException, org.dbunit.dataset.DataSetException
- Deprecated. use
FlatDtdDataSet.write(org.dbunit.dataset.IDataSet, java.io.OutputStream)55- Write a DTD for the specified dataset to the specified output.
- Write a DTD for the specified dataset to the specified output.
|
|||||||||
| Home >> All >> org >> dbunit >> dataset >> [ xml overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC