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
public class FlatXmlProducer
- extends org.xml.sax.helpers.DefaultHandler
- implements IDataSetProducer, ContentHandler
- Since:
- 1.5 (Apr 18, 2003)
- Version:
- $Revision: 911 $ $Date: 2008-12-05 22:28:45 +0100 (Fri, 05 Dec 2008) $
- Author:
- Manuel Laflamme, Last changed by: $Author: gommma $
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
characters, endDocument, endPrefixMapping, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FlatXmlProducer
public FlatXmlProducer(InputSource xmlSource)
FlatXmlProducer
public FlatXmlProducer(InputSource xmlSource,
boolean dtdMetadata)
FlatXmlProducer
public FlatXmlProducer(InputSource xmlSource,
IDataSet metaDataSet)
FlatXmlProducer
public FlatXmlProducer(InputSource xmlSource,
EntityResolver resolver)
FlatXmlProducer
public FlatXmlProducer(InputSource xmlSource,
boolean dtdMetadata,
boolean columnSensing)
- 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
handleMissingColumns
protected void handleMissingColumns(Attributes attributes)
throws DataSetException
- parses the attributes in the current row, and checks whether a new column
is found.
Depending on the value of the columnSensing
flag, 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
public void setConsumer(IDataSetConsumer consumer)
throws DataSetException
- Specified by:
setConsumer
in interface IDataSetProducer
- Throws:
DataSetException
produce
public void produce()
throws DataSetException
- Description copied from interface:
IDataSetProducer
- Process 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:
produce
in interface IDataSetProducer
- Throws:
DataSetException
resolveEntity
public InputSource resolveEntity(String publicId,
String systemId)
throws SAXException
- Specified by:
resolveEntity
in interface EntityResolver
- Overrides:
resolveEntity
in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
error
public void error(SAXParseException e)
throws SAXException
- Specified by:
error
in interface ErrorHandler
- Overrides:
error
in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Specified by:
startElement
in interface ContentHandler
- Overrides:
startElement
in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
- Specified by:
endElement
in interface ContentHandler
- Overrides:
endElement
in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
Copyright © 2002-2012. All Rights Reserved.