edu.jhu.tmaj.util
Class XmlUtil

java.lang.Object
  extended by edu.jhu.tmaj.util.XmlUtil

public final class XmlUtil
extends java.lang.Object


Method Summary
static org.jdom.Element readXmlFromFile(java.io.File xmlFile)
          Gets the root element of an XML file.
static org.jdom.Element readXmlFromInternalFile(java.lang.String xmlFileName)
           
static void verifyChildrenNames(org.jdom.Element element, java.lang.String... childrenNames)
          Throws an exception if the element's children don't have the supplied names.
static void verifyElementName(org.jdom.Element element, java.lang.String correctName)
          Throws an exception if the element doesn't have the supplied name.
static void verifyFirstChildrenNames(org.jdom.Element element, java.lang.String... childrenNames)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readXmlFromFile

public static org.jdom.Element readXmlFromFile(java.io.File xmlFile)
                                        throws java.io.IOException,
                                               org.jdom.JDOMException
Gets the root element of an XML file.

Throws:
java.io.IOException
org.jdom.JDOMException

readXmlFromInternalFile

public static org.jdom.Element readXmlFromInternalFile(java.lang.String xmlFileName)
                                                throws java.io.IOException,
                                                       org.jdom.JDOMException
Throws:
java.io.IOException
org.jdom.JDOMException

verifyElementName

public static void verifyElementName(org.jdom.Element element,
                                     java.lang.String correctName)
Throws an exception if the element doesn't have the supplied name.


verifyChildrenNames

public static void verifyChildrenNames(org.jdom.Element element,
                                       java.lang.String... childrenNames)
Throws an exception if the element's children don't have the supplied names.


verifyFirstChildrenNames

public static void verifyFirstChildrenNames(org.jdom.Element element,
                                            java.lang.String... childrenNames)