org.dbunit.dataset.xml
Class XmlProducer
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.dbunit.dataset.xml.XmlProducer
- All Implemented Interfaces:
- IDataSetProducer, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class XmlProducer
- extends org.xml.sax.helpers.DefaultHandler
- implements IDataSetProducer, org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler
Parses an XML and produces a dataset from it.
- Since:
- Apr 30, 2003
- Version:
- $Revision: 815 $ $Date: 2008-09-27 14:33:56 +0200 (sab, 27 set 2008) $
- Author:
- Manuel Laflamme, Last changed by: $Author: gommma $
|
Constructor Summary |
XmlProducer(org.xml.sax.InputSource inputSource)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
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 |
| Methods inherited from interface org.xml.sax.ContentHandler |
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping |
| Methods inherited from interface org.xml.sax.ErrorHandler |
fatalError, warning |
XmlProducer
public XmlProducer(org.xml.sax.InputSource inputSource)
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
buildException
protected static final DataSetException buildException(org.xml.sax.SAXException cause)
- Wraps a
SAXException into a DataSetException
- Parameters:
cause - The cause to be wrapped into a DataSetException
- Returns:
- A
DataSetException that wraps the given SAXException
resolveEntity
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException
- Specified by:
resolveEntity in interface org.xml.sax.EntityResolver- Overrides:
resolveEntity in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Specified by:
startElement in interface org.xml.sax.ContentHandler- Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Specified by:
endElement in interface org.xml.sax.ContentHandler- Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
characters
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
- Specified by:
characters in interface org.xml.sax.ContentHandler- Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
error
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
- Specified by:
error in interface org.xml.sax.ErrorHandler- Overrides:
error in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
Copyright © 2002-2010. All Rights Reserved.