Package org.dbunit.dataset.xml
Class FlatXmlDataSetBuilder
java.lang.Object
org.dbunit.dataset.xml.FlatXmlDataSetBuilder
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the flat XML input source from which theFlatXmlDataSetis to be builtbuild(InputStream xmlInputStream) Sets the flat XML input source from which theFlatXmlDataSetis to be builtSets the flat XML input source from which theFlatXmlDataSetis to be builtSets the flat XML input source from which theFlatXmlDataSetis to be builtbuild(InputSource inputSource) Sets the flat XML input source from which theFlatXmlDataSetis to be builtprotected FlatXmlProducercreateProducer(InputSource inputSource) Creates the producer used to build theFlatXmlDataSet, using this builder's configured metadata source or properties.booleanWhether or not the created dataset should use case sensitive table names.booleanWhether or not column sensing is enabled.booleanWhether or not DTD metadata is available to parse via a DTD handler.setCaseSensitiveTableNames(boolean caseSensitiveTableNames) Whether or not the created dataset should use case sensitive table namessetColumnSensing(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.setDtdMetadata(boolean dtdMetadata) Whether or not DTD metadata is available to parse via a DTD handler.setMetaDataSet(IDataSet metaDataSet) Set the metadata information (column info etc.) to be used.setMetaDataSetFromDtd(InputStream dtdStream) Set the metadata information (column info etc.) to be used from the given DTD input.setMetaDataSetFromDtd(Reader dtdReader) Set the metadata information (column info etc.) to be used from the given DTD input.toString()
-
Constructor Details
-
FlatXmlDataSetBuilder
public FlatXmlDataSetBuilder()Default constructor
-
-
Method Details
-
build
Sets the flat XML input source from which theFlatXmlDataSetis to be built- Parameters:
inputSource- The flat XML input asInputSource- Returns:
- The created
FlatXmlDataSet - Throws:
DataSetException- if the dataset cannot be built.
-
build
Sets the flat XML input source from which theFlatXmlDataSetis to be built- Parameters:
xmlInputFile- The flat XML input asFile- Returns:
- The created
FlatXmlDataSet - Throws:
MalformedURLException- if the file's path cannot be converted to a URL.DataSetException- if the dataset cannot be built.
-
build
Sets the flat XML input source from which theFlatXmlDataSetis to be built- Parameters:
xmlInputUrl- The flat XML input asURL- Returns:
- The created
FlatXmlDataSet - Throws:
DataSetException- if the dataset cannot be built.
-
build
Sets the flat XML input source from which theFlatXmlDataSetis to be built- Parameters:
xmlReader- The flat XML input asReader- Returns:
- The created
FlatXmlDataSet - Throws:
DataSetException- if the dataset cannot be built.
-
build
Sets the flat XML input source from which theFlatXmlDataSetis to be built- Parameters:
xmlInputStream- The flat XML input asInputStream- Returns:
- The created
FlatXmlDataSet - Throws:
DataSetException- if the dataset cannot be built.
-
setMetaDataSet
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- the metadata source.- 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- if the DTD content is invalid.IOException- if the reader cannot be read.
-
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- A stream that provides the DTD content- Returns:
- this
- Throws:
DataSetException- if the DTD content is invalid.IOException- if the stream cannot be read.
-
isDtdMetadata
public boolean isDtdMetadata()Whether or not DTD metadata is available to parse via a DTD handler.- Returns:
- whether or not DTD metadata is available to parse via a DTD handler.
-
setDtdMetadata
Whether or not DTD metadata is available to parse via a DTD handler.- Parameters:
dtdMetadata- whether or not DTD metadata is available to parse via a DTD handler.- Returns:
- this
-
isColumnSensing
public boolean isColumnSensing()Whether or not column sensing is enabled.- Returns:
- whether or not column sensing is enabled.
-
setColumnSensing
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- whether or not column sensing is enabled.- Returns:
- this
-
isCaseSensitiveTableNames
public boolean isCaseSensitiveTableNames()Whether or not the created dataset should use case sensitive table names.- Returns:
- whether or not the created dataset should use case sensitive table names.
-
setCaseSensitiveTableNames
Whether or not the created dataset should use case sensitive table names- Parameters:
caseSensitiveTableNames- whether or not the created dataset should use case sensitive table names.- Returns:
- this
-
createProducer
Creates the producer used to build theFlatXmlDataSet, using this builder's configured metadata source or properties.- Parameters:
inputSource- The XML input to be built- Returns:
- The producer which is used to create the
FlatXmlDataSet
-
toString
-