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) booleanbooleanbooleansetCaseSensitiveTableNames(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
-
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:
DataSetExceptionMalformedURLException
-
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
-
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
-
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
-
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-- 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:
DataSetExceptionIOException
-
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:
DataSetExceptionIOException
-
isDtdMetadata
public boolean isDtdMetadata() -
setDtdMetadata
Whether or not DTD metadata is available to parse via a DTD handler.- Parameters:
dtdMetadata-- Returns:
- this
-
isColumnSensing
public boolean isColumnSensing() -
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-- Returns:
- this
-
isCaseSensitiveTableNames
public boolean isCaseSensitiveTableNames() -
setCaseSensitiveTableNames
Whether or not the created dataset should use case sensitive table names- Parameters:
caseSensitiveTableNames-- Returns:
- this
-
createProducer
- Parameters:
inputSource- The XML input to be built- Returns:
- The producer which is used to create the
FlatXmlDataSet
-
toString
-