Package org.dbunit.dataset.xml
Class FlatXmlProducer
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.dbunit.dataset.xml.FlatXmlProducer
- All Implemented Interfaces:
IDataSetProducer,ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Since:
- 1.5 (Apr 18, 2003)
- Version:
- $Revision$ $Date$
- Author:
- Manuel Laflamme, Last changed by: $Author$
-
Constructor Summary
ConstructorsConstructorDescriptionFlatXmlProducer(InputSource xmlSource) FlatXmlProducer(InputSource xmlSource, boolean dtdMetadata) FlatXmlProducer(InputSource xmlSource, boolean dtdMetadata, boolean columnSensing) FlatXmlProducer(InputSource xmlSource, boolean dtdMetadata, boolean columnSensing, boolean caseSensitiveTableNames) FlatXmlProducer(InputSource xmlSource, IDataSet metaDataSet) FlatXmlProducer(InputSource xmlSource, EntityResolver resolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddetermineAndSetRowValue(Attributes attributes, ITableMetaData activeMetaData, Object[] rowValues, int i) voidendElement(String uri, String localName, String qName) voidprotected voidhandleMissingColumns(Attributes attributes) parses the attributes in the current row, and checks whether a new column is found.booleanvoidproduce()Process this dataset source.resolveEntity(String publicId, String systemId) voidsetColumnSensing(boolean columnSensing) voidsetConsumer(IDataSetConsumer consumer) voidsetValidating(boolean validating) voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
characters, declaration, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
-
Constructor Details
-
FlatXmlProducer
-
FlatXmlProducer
-
FlatXmlProducer
-
FlatXmlProducer
-
FlatXmlProducer
- Parameters:
xmlSource- The input datasourcedtdMetadata- Whether or not DTD metadata is available to parse via a DTD handlercolumnSensing- Whether or not the column sensing feature should be used (see FAQ)
-
FlatXmlProducer
public FlatXmlProducer(InputSource xmlSource, boolean dtdMetadata, boolean columnSensing, boolean caseSensitiveTableNames) - Parameters:
xmlSource- The input datasourcedtdMetadata- Whether or not DTD metadata is available to parse via a DTD handlercolumnSensing- Whether or not the column sensing feature should be used (see FAQ)caseSensitiveTableNames- Whether or not this dataset should use case sensitive table names- Since:
- 2.4.2
-
-
Method Details
-
isCaseSensitiveTableNames
public boolean isCaseSensitiveTableNames()- Returns:
- Whether or not this producer works case sensitively
- Since:
- 2.4.7
-
handleMissingColumns
parses the attributes in the current row, and checks whether a new column is found.Depending on the value of the
columnSensingflag, the appropriate action is taken:- If it is true, the new column is merged back into the metadata;
- If not, a warning message is displayed.
- Parameters:
attributes- Attributed for the current row.- Throws:
DataSetException
-
setColumnSensing
public void setColumnSensing(boolean columnSensing) -
setValidating
public void setValidating(boolean validating) -
setConsumer
- Specified by:
setConsumerin interfaceIDataSetProducer- Throws:
DataSetException
-
produce
Description copied from interface:IDataSetProducerProcess this dataset source. During the processing, the IDataSetProducer will provide information about the dataset through the specified event listener.This method is synchronous: it will not return until processing has ended. If a client application wants to terminate parsing early, it should throw an exception from the listener.
- Specified by:
producein interfaceIDataSetProducer- Throws:
DataSetException
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin classDefaultHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
determineAndSetRowValue
protected void determineAndSetRowValue(Attributes attributes, ITableMetaData activeMetaData, Object[] rowValues, int i) throws DataSetException, NoSuchColumnException -
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-