org.dbunit.dataset.xml
Class FlatXmlDataSetBuilder

java.lang.Object
  extended by org.dbunit.dataset.xml.FlatXmlDataSetBuilder

public final class FlatXmlDataSetBuilder
extends java.lang.Object

Builder for the creation of FlatXmlDataSet instances.

Since:
2.4.7
Version:
$Revision: 1048 $ $Date: 2009-09-26 18:21:40 +0200 (sab, 26 set 2009) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $
See Also:
FlatXmlDataSet

Constructor Summary
FlatXmlDataSetBuilder()
          Default constructor
 
Method Summary
 FlatXmlDataSet build(java.io.File xmlInputFile)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(org.xml.sax.InputSource inputSource)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(java.io.InputStream xmlInputStream)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(java.io.Reader xmlReader)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(java.net.URL xmlInputUrl)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
protected  FlatXmlProducer createProducer(org.xml.sax.InputSource inputSource)
           
 boolean isCaseSensitiveTableNames()
           
 boolean isColumnSensing()
           
 boolean isDtdMetadata()
           
 FlatXmlDataSetBuilder setCaseSensitiveTableNames(boolean caseSensitiveTableNames)
          Whether or not the created dataset should use case sensitive table names
 FlatXmlDataSetBuilder setColumnSensing(boolean columnSensing)
          Since DBUnit 2.3.0 there is a functionality called "column sensing" which basically reads in the whole XML into a buffer and dynamically adds new columns as they appear.
 FlatXmlDataSetBuilder setDtdMetadata(boolean dtdMetadata)
          Whether or not DTD metadata is available to parse via a DTD handler.
 FlatXmlDataSetBuilder setMetaDataSet(IDataSet metaDataSet)
          Set the metadata information (column info etc.) to be used.
 FlatXmlDataSetBuilder setMetaDataSetFromDtd(java.io.InputStream dtdStream)
          Set the metadata information (column info etc.) to be used from the given DTD input.
 FlatXmlDataSetBuilder setMetaDataSetFromDtd(java.io.Reader dtdReader)
          Set the metadata information (column info etc.) to be used from the given DTD input.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlatXmlDataSetBuilder

public FlatXmlDataSetBuilder()
Default constructor

Method Detail

build

public FlatXmlDataSet build(org.xml.sax.InputSource inputSource)
                     throws DataSetException
Sets the flat XML input source from which the FlatXmlDataSet is to be built

Parameters:
inputSource - The flat XML input as InputSource
Returns:
The created FlatXmlDataSet
Throws:
DataSetException

build

public FlatXmlDataSet build(java.io.File xmlInputFile)
                     throws java.net.MalformedURLException,
                            DataSetException
Sets the flat XML input source from which the FlatXmlDataSet is to be built

Parameters:
xmlInputFile - The flat XML input as File
Returns:
The created FlatXmlDataSet
Throws:
DataSetException
java.net.MalformedURLException

build

public FlatXmlDataSet build(java.net.URL xmlInputUrl)
                     throws DataSetException
Sets the flat XML input source from which the FlatXmlDataSet is to be built

Parameters:
xmlInputUrl - The flat XML input as URL
Returns:
The created FlatXmlDataSet
Throws:
DataSetException

build

public FlatXmlDataSet build(java.io.Reader xmlReader)
                     throws DataSetException
Sets the flat XML input source from which the FlatXmlDataSet is to be built

Parameters:
xmlReader - The flat XML input as Reader
Returns:
The created FlatXmlDataSet
Throws:
DataSetException

build

public FlatXmlDataSet build(java.io.InputStream xmlInputStream)
                     throws DataSetException
Sets the flat XML input source from which the FlatXmlDataSet is to be built

Parameters:
xmlInputStream - The flat XML input as InputStream
Returns:
The created FlatXmlDataSet
Throws:
DataSetException

setMetaDataSet

public FlatXmlDataSetBuilder setMetaDataSet(IDataSet metaDataSet)
Set the metadata information (column info etc.) to be used. May come from a DTD. This has precedence to the other builder's properties.

Parameters:
metaDataSet -
Returns:
this

setMetaDataSetFromDtd

public FlatXmlDataSetBuilder setMetaDataSetFromDtd(java.io.Reader dtdReader)
                                            throws DataSetException,
                                                   java.io.IOException
Set the metadata information (column info etc.) to be used from the given DTD input. This has precedence to the other builder's properties.

Parameters:
dtdReader - A reader that provides the DTD content
Returns:
this
Throws:
DataSetException
java.io.IOException

setMetaDataSetFromDtd

public FlatXmlDataSetBuilder setMetaDataSetFromDtd(java.io.InputStream dtdStream)
                                            throws DataSetException,
                                                   java.io.IOException
Set the metadata information (column info etc.) to be used from the given DTD input. This has precedence to the other builder's properties.

Parameters:
dtdStream -
Returns:
this
Throws:
DataSetException
java.io.IOException

isDtdMetadata

public boolean isDtdMetadata()

setDtdMetadata

public FlatXmlDataSetBuilder setDtdMetadata(boolean dtdMetadata)
Whether or not DTD metadata is available to parse via a DTD handler.

Parameters:
dtdMetadata -
Returns:
this

isColumnSensing

public boolean isColumnSensing()

setColumnSensing

public FlatXmlDataSetBuilder setColumnSensing(boolean columnSensing)
Since DBUnit 2.3.0 there is a functionality called "column sensing" which basically reads in the whole XML into a buffer and dynamically adds new columns as they appear.

Parameters:
columnSensing -
Returns:
this

isCaseSensitiveTableNames

public boolean isCaseSensitiveTableNames()

setCaseSensitiveTableNames

public FlatXmlDataSetBuilder setCaseSensitiveTableNames(boolean caseSensitiveTableNames)
Whether or not the created dataset should use case sensitive table names

Parameters:
caseSensitiveTableNames -
Returns:
this

createProducer

protected FlatXmlProducer createProducer(org.xml.sax.InputSource inputSource)
Parameters:
inputSource - The XML input to be built
Returns:
The producer which is used to create the FlatXmlDataSet

toString

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


Copyright © 2002-2010. All Rights Reserved.