org.ourgrid.common.xml
Class XMLParser

java.lang.Object
  extended by org.ourgrid.common.xml.XMLParser

public class XMLParser
extends java.lang.Object

Objects of this class knows how to parse a MyGrid Doctor test description XML file.


Constructor Summary
XMLParser(java.lang.String filePath)
          The constructor.
 
Method Summary
 java.lang.Throwable getCause(org.w3c.dom.NodeList exceptionList, java.lang.Throwable exception)
          This method returns the exception cause.
 java.lang.String getCauseById(java.lang.String id)
          This method returns a cause by a given id
 org.w3c.dom.NodeList getCauses(org.w3c.dom.Node node)
          This method returns a node list of causes of a given causes node.
 java.lang.String[] getDependencies(java.lang.String testName)
          This method returns the dependencies of a test.
 java.lang.String getDiagnostic(org.w3c.dom.Node node)
          This method returns the diagnostic of a given diagnostic node.
 java.lang.String getDiagnosticById(java.lang.String id)
          This method returns a diagnostic by a given id.
 org.w3c.dom.Element getDocumentElement()
          This method returns the root element of the XML configuration file.
 org.w3c.dom.Node getExceptionDetails(org.w3c.dom.NodeList exceptionList, java.lang.Throwable exception)
          This method returns the detailed exception node according to exception.
 org.w3c.dom.NodeList getExceptionList(java.lang.String testName)
          This method returns the Exception list of a given test.
 java.lang.String getExceptionName(org.w3c.dom.Node node)
          This method returns the exception name of a given exception node.
 java.lang.String getPrescriptionById(java.lang.String id)
          This method returns a prescription by a given id.
 org.w3c.dom.NodeList getPrescriptions(org.w3c.dom.Node node)
          This method returns a node list of prescriptions of a given prescriptions node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLParser

public XMLParser(java.lang.String filePath)
          throws XMLParserException,
                 java.io.IOException
The constructor.

Parameters:
filePath - XML configuration file path
Throws:
java.io.IOException
XMLParserException
Method Detail

getDocumentElement

public org.w3c.dom.Element getDocumentElement()
This method returns the root element of the XML configuration file.

Returns:
The root element of the XML configuration file

getDiagnosticById

public java.lang.String getDiagnosticById(java.lang.String id)
This method returns a diagnostic by a given id.

Parameters:
id - Diagnostic id
Returns:
The diagnostic that matches the given id

getCauseById

public java.lang.String getCauseById(java.lang.String id)
This method returns a cause by a given id

Parameters:
id - Cause id
Returns:
The cause that matches the given id

getPrescriptionById

public java.lang.String getPrescriptionById(java.lang.String id)
This method returns a prescription by a given id.

Parameters:
id - Prescription id
Returns:
A String containing the prescription that matches the specified id

getExceptionList

public org.w3c.dom.NodeList getExceptionList(java.lang.String testName)
This method returns the Exception list of a given test.

Parameters:
testName - Test name
Returns:
A NodeList with exceptions that can ocurrs in the test

getDependencies

public java.lang.String[] getDependencies(java.lang.String testName)
This method returns the dependencies of a test.

Parameters:
testName - Test name
Returns:
An array of string containing the dependencies of the given test

getExceptionDetails

public org.w3c.dom.Node getExceptionDetails(org.w3c.dom.NodeList exceptionList,
                                            java.lang.Throwable exception)
This method returns the detailed exception node according to exception.

Parameters:
exceptionList - Node list of exceptions
exception - Exception catched
Returns:
The detailed exception node according to exception

getCause

public java.lang.Throwable getCause(org.w3c.dom.NodeList exceptionList,
                                    java.lang.Throwable exception)
This method returns the exception cause.

Parameters:
exceptionList - Node list of exceptions
exception - Exception catched
Returns:
The cause of the given exception

getExceptionName

public java.lang.String getExceptionName(org.w3c.dom.Node node)
This method returns the exception name of a given exception node.

Parameters:
node - Exception node
Returns:
Exception name

getDiagnostic

public java.lang.String getDiagnostic(org.w3c.dom.Node node)
This method returns the diagnostic of a given diagnostic node.

Parameters:
node - Diagnostic node
Returns:
The diagnostic obtained from the given node

getCauses

public org.w3c.dom.NodeList getCauses(org.w3c.dom.Node node)
This method returns a node list of causes of a given causes node.

Parameters:
node - Causes node
Returns:
A NodeList containing the causes of the given node

getPrescriptions

public org.w3c.dom.NodeList getPrescriptions(org.w3c.dom.Node node)
This method returns a node list of prescriptions of a given prescriptions node.

Parameters:
node - Prescriptions node
Returns:
A NodeList containing the prescriptions of the given node