net.sf.jameleon.util
Class XMLHelper

java.lang.Object
  extended by net.sf.jameleon.util.XMLHelper

public class XMLHelper
extends Object


Field Summary
protected  org.dom4j.Document document
           
protected  org.dom4j.io.SAXReader parser
           
 
Constructor Summary
XMLHelper(String xml)
          Contstructor
XMLHelper(URL xmlFile)
          Contstructor
 
Method Summary
protected  String cleanNestedMessage(Throwable t)
           
 boolean getBooleanValueFromXPath(String xpath)
          Gets the boolean value of the given tag
 org.dom4j.Document getDocument()
          Gets the Document for the XML represented by the provided text
 List getListFromXPath(String xpath)
          Gets a list of Nodes from the xml
 String getValueFromXPath(String xpath)
          Gets the text value of the given tag
 List getValuesFromXPath(String xpath)
          Gets a list of Values from the xml
protected  void setUpSaxReader()
          Set up the SAXReader such that it understands the jameleon namespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected org.dom4j.io.SAXReader parser

document

protected org.dom4j.Document document
Constructor Detail

XMLHelper

public XMLHelper(String xml)
Contstructor

Parameters:
xml - - The XML to parse

XMLHelper

public XMLHelper(URL xmlFile)
Contstructor

Parameters:
xmlFile - - The XML to parse
Method Detail

setUpSaxReader

protected void setUpSaxReader()
Set up the SAXReader such that it understands the jameleon namespace


getValueFromXPath

public String getValueFromXPath(String xpath)
Gets the text value of the given tag

Parameters:
xpath - - the xpath representing a tag
Returns:
The text representing the tag

getBooleanValueFromXPath

public boolean getBooleanValueFromXPath(String xpath)
Gets the boolean value of the given tag

Parameters:
xpath - - the xpath representing a tag
Returns:
a boolean value of the given tag

getDocument

public org.dom4j.Document getDocument()
Gets the Document for the XML represented by the provided text

Returns:
The Document for the XML represented by the provided text

getValuesFromXPath

public List getValuesFromXPath(String xpath)
Gets a list of Values from the xml

Parameters:
xpath - - the xpath representing the desired tags
Returns:
a List of nodes matching the xpath

getListFromXPath

public List getListFromXPath(String xpath)
Gets a list of Nodes from the xml

Parameters:
xpath - - the xpath representing the desired tags
Returns:
a List of nodes matching the xpath

cleanNestedMessage

protected String cleanNestedMessage(Throwable t)


Copyright © 2003-2008 Christian Hargraves. All Rights Reserved.