public class XMLQueryVisitationStrategy extends Object
This program helps in parsing XML Query and Results files into map objects containing individual queries/ResultSets
This program is useful to convert the JDBC ResultSet objects into XML format. We physically walk through the ResultSet object and use JDOM to convert the ResultSets into XML. This also helps convert Exceptions into XML format.
Constructor and Description |
---|
XMLQueryVisitationStrategy() |
Modifier and Type | Method and Description |
---|---|
static org.jdom.Element |
jdomException(Throwable ex,
org.jdom.Element exceptionElement)
Generate XML for an exception in Object form.
|
List |
parseXMLQueryFile(String queryScenarioID,
File queryFile,
String querySetID)
Consume an XML Query File and produce a Map containing queries, with
queryNames/IDs as Keys.
|
ResultsHolder |
parseXMLResultsFile(File resultsFile)
Consume an XML results File and produce a Map containing query results
as List objects, with resultNames/IDs as Keys.
|
org.jdom.Element |
parseXMLResultsFile(File resultsFile,
org.jdom.Element parent)
Consume an XML results File, produce results as JDOM and add results to the given parent.
|
org.jdom.Element |
produceMsg(Object object,
org.jdom.Element parent)
Produce a JDOM Element for the instance of any Object.
|
org.jdom.Element |
produceMsg(ResultSet object,
org.jdom.Element resultsElement)
Produce a JDOM Element for an instance of a JDBC ResultSet object.
|
org.jdom.Element |
produceResults(ResultSet object)
Produce a JDOM Element for an instance of a JDBC ResultSet object.
|
public List parseXMLQueryFile(String queryScenarioID, File queryFile, String querySetID) throws IOException, org.jdom.JDOMException
queryFile
- the XML file object that is to be parsedorg.jdom.JDOMException
- if there is an error consuming the message.IOException
public ResultsHolder parseXMLResultsFile(File resultsFile) throws IOException, org.jdom.JDOMException
resultsFile
- the XML file object that is to be parsedorg.jdom.JDOMException
- if there is an error consuming the message.IOException
public org.jdom.Element parseXMLResultsFile(File resultsFile, org.jdom.Element parent) throws IOException, org.jdom.JDOMException
resultsFile
- the XML file object that is to be parsedparent
- the parent Element to assign results toorg.jdom.JDOMException
- if there is an error consuming the message.IOException
public static org.jdom.Element jdomException(Throwable ex, org.jdom.Element exceptionElement)
ex
- exceptionElement
- public org.jdom.Element produceResults(ResultSet object) throws org.jdom.JDOMException, SQLException
object
- for which the JDOM Element is to be produced.org.jdom.JDOMException
- if there is an error producing XML.org.jdom.JDOMException
- if there is an error producing XML.SQLException
- if there is an error walking through the ResultSet object.public org.jdom.Element produceMsg(ResultSet object, org.jdom.Element resultsElement) throws org.jdom.JDOMException, SQLException
object
- for which the JDOM Element is to be produced.org.jdom.JDOMException
- if there is an error producing XML.SQLException
- if there is an error walking through the ResultSet object.public org.jdom.Element produceMsg(Object object, org.jdom.Element parent) throws org.jdom.JDOMException, SQLException
object
- the instance for which the message is to be produced.parent
- the XML element that is to be the parent of the produced XML message.org.jdom.JDOMException
- if there is an error producing XML.SQLException
Copyright © 2018 JBoss by Red Hat. All rights reserved.