Package org.dbunit.dataset.xml
Class XmlProducer
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.dbunit.dataset.xml.XmlProducer
- All Implemented Interfaces:
IDataSetProducer,ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class XmlProducer
extends DefaultHandler
implements IDataSetProducer, ContentHandler, ErrorHandler
Parses an XML and produces a dataset from it.
- Since:
- Apr 30, 2003
- Version:
- $Revision$ $Date$
- Author:
- Manuel Laflamme, Last changed by: $Author$
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static final DataSetExceptionbuildException(SAXException cause) Wraps aSAXExceptioninto aDataSetExceptionvoidcharacters(char[] ch, int start, int length) voidendElement(String uri, String localName, String qName) voidvoidproduce()Process this dataset source.resolveEntity(String publicId, String systemId) voidsetConsumer(IDataSetConsumer consumer) voidsetValidating(boolean validating) voidstartElement(String uri, String localName, String qName, Attributes attributes) Methods inherited from class org.xml.sax.helpers.DefaultHandler
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
declaration, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMappingMethods inherited from interface org.xml.sax.ErrorHandler
fatalError, warning
-
Constructor Details
-
XmlProducer
-
-
Method Details
-
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
-
buildException
Wraps aSAXExceptioninto aDataSetException- Parameters:
cause- The cause to be wrapped into aDataSetException- Returns:
- A
DataSetExceptionthat wraps the givenSAXException
-
resolveEntity
- Specified by:
resolveEntityin interfaceEntityResolver- Overrides:
resolveEntityin 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
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-