org.dbunit.dataset.xml
Class FlatXmlProducer
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.dbunit.dataset.xml.FlatXmlProducer
- All Implemented Interfaces:
- IDataSetProducer, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
public class FlatXmlProducer
- extends org.xml.sax.helpers.DefaultHandler
- implements IDataSetProducer, org.xml.sax.ContentHandler
- Since:
- Apr 18, 2003
- Version:
- $Revision: 696 $
- Author:
- Manuel Laflamme
|
Method Summary |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
void |
error(org.xml.sax.SAXParseException e)
|
protected void |
handleMissingColumns(java.lang.String qName,
org.xml.sax.Attributes attributes)
parses the attributes in the current row, and checks whether a new column
is found. |
void |
produce()
Process this dataset source. |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
|
void |
setColumnSensing(boolean columnSensing)
|
void |
setConsumer(IDataSetConsumer consumer)
|
void |
setValidating(boolean validating)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
| 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 |
| Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping |
FlatXmlProducer
public FlatXmlProducer(org.xml.sax.InputSource xmlSource)
FlatXmlProducer
public FlatXmlProducer(org.xml.sax.InputSource xmlSource,
boolean dtdMetadata)
FlatXmlProducer
public FlatXmlProducer(org.xml.sax.InputSource xmlSource,
IDataSet metaDataSet)
FlatXmlProducer
public FlatXmlProducer(org.xml.sax.InputSource xmlSource,
org.xml.sax.EntityResolver resolver)
FlatXmlProducer
public FlatXmlProducer(org.xml.sax.InputSource xmlSource,
boolean dtdMetadata,
boolean columnSensing)
handleMissingColumns
protected void handleMissingColumns(java.lang.String qName,
org.xml.sax.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:
qName - Name of the current table.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 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
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
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
Copyright © 2002-2008. All Rights Reserved.