org.dbunit.dataset.xml
Class FlatXmlDataSetBuilder

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

public final class FlatXmlDataSetBuilder
extends Object

Builder for the creation of FlatXmlDataSet instances.

Since:
2.4.7
Version:
$Revision$ $Date$
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
See Also:
FlatXmlDataSet

Constructor Summary
FlatXmlDataSetBuilder()
          Default constructor
 
Method Summary
 FlatXmlDataSet build(File xmlInputFile)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(InputSource inputSource)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(InputStream xmlInputStream)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(Reader xmlReader)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
 FlatXmlDataSet build(URL xmlInputUrl)
          Sets the flat XML input source from which the FlatXmlDataSet is to be built
protected  FlatXmlProducer createProducer(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(InputStream dtdStream)
          Set the metadata information (column info etc.) to be used from the given DTD input.
 FlatXmlDataSetBuilder setMetaDataSetFromDtd(Reader dtdReader)
          Set the metadata information (column info etc.) to be used from the given DTD input.
 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(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(File xmlInputFile)
                     throws 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
MalformedURLException

build

public FlatXmlDataSet build(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(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(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(Reader dtdReader)
                                            throws DataSetException,
                                                   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
IOException

setMetaDataSetFromDtd

public FlatXmlDataSetBuilder setMetaDataSetFromDtd(InputStream dtdStream)
                                            throws DataSetException,
                                                   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
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(InputSource inputSource)
Parameters:
inputSource - The XML input to be built
Returns:
The producer which is used to create the FlatXmlDataSet

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002–2014. All rights reserved.