|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.memphis.ccrg.lida.framework.initialization.XmlUtils
public class XmlUtils
Utilities for reading an XML file.
Constructor Summary | |
---|---|
XmlUtils()
|
Method Summary | |
---|---|
static boolean |
getBooleanValue(org.w3c.dom.Element ele,
java.lang.String tagName)
Returns a Boolean with value true if the first element inside specified element has specified tag contains 'true' ignoring case. |
static org.w3c.dom.Element |
getChild(org.w3c.dom.Element parent,
java.lang.String name)
Returns the first child of specified Element with specified name. |
static java.util.List<org.w3c.dom.Element> |
getChildren(org.w3c.dom.Element parent,
java.lang.String name)
Returns all children with specified name. |
static java.util.List<org.w3c.dom.Element> |
getChildrenInGroup(org.w3c.dom.Element e,
java.lang.String groupName,
java.lang.String childName)
Returns the Elements with name childName, in the group groupName inside the specified Element e. |
static java.util.List<java.lang.String> |
getChildrenValues(org.w3c.dom.Element element,
java.lang.String name)
Gets the values of the children of the element with specified name. |
static java.lang.Integer |
getIntegerValue(org.w3c.dom.Element ele,
java.lang.String tagName)
Returns Integer value of first element inside specified element with specified tag or else null. |
static java.util.Map<java.lang.String,java.lang.Object> |
getParams(org.w3c.dom.Element moduleElement)
Reads and creates a Properties from specified Element |
static java.lang.String |
getTextValue(org.w3c.dom.Element ele,
java.lang.String tagName)
Returns text value of first element in specified element with specified tag. |
static java.util.Map<java.lang.String,java.lang.Object> |
getTypedParams(org.w3c.dom.Element moduleElement)
Reads typed parameters from xml element and returns them in a Map where the key is the parameter's String name and the value is the value of the parameter. |
static java.lang.String |
getValue(org.w3c.dom.Element parent)
Returns String value of first child found that is a Text . |
static org.w3c.dom.Document |
parseXmlFile(java.lang.String fileName,
java.lang.String schemaFilePath)
Verifies and parses specified xml file into a Document . |
static org.w3c.dom.Document |
parseXmlString(java.lang.String xml)
Parses a String containing xml data into a dom Document |
static boolean |
validateXmlFile(java.lang.String xmlFile,
java.lang.String schemaFile)
Validates specified XML file with specified XML schema file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlUtils()
Method Detail |
---|
public static boolean validateXmlFile(java.lang.String xmlFile, java.lang.String schemaFile)
xmlFile
- name of xml fileschemaFile
- name of schema file
public static java.lang.String getTextValue(org.w3c.dom.Element ele, java.lang.String tagName)
ele
- Dom elementtagName
- name of xml tag
public static java.lang.Integer getIntegerValue(org.w3c.dom.Element ele, java.lang.String tagName)
ele
- Dom elementtagName
- name of xml tag
public static boolean getBooleanValue(org.w3c.dom.Element ele, java.lang.String tagName)
ele
- Dom elementtagName
- name of xml tag
public static java.util.Map<java.lang.String,java.lang.Object> getParams(org.w3c.dom.Element moduleElement)
moduleElement
- Dom element
public static java.util.Map<java.lang.String,java.lang.Object> getTypedParams(org.w3c.dom.Element moduleElement)
moduleElement
- Dom Element
public static org.w3c.dom.Element getChild(org.w3c.dom.Element parent, java.lang.String name)
parent
- an Element
name
- name of child specified
public static java.lang.String getValue(org.w3c.dom.Element parent)
Text
. or null
if the Text is empty
parent
- Element
public static java.util.List<java.lang.String> getChildrenValues(org.w3c.dom.Element element, java.lang.String name)
element
- Parent Element
name
- specified tag name
public static java.util.List<org.w3c.dom.Element> getChildren(org.w3c.dom.Element parent, java.lang.String name)
parent
- Element
name
- name of sought children
public static java.util.List<org.w3c.dom.Element> getChildrenInGroup(org.w3c.dom.Element e, java.lang.String groupName, java.lang.String childName)
e
- Element
groupName
- name of the groupchildName
- name of children Elements returned
Element
spublic static org.w3c.dom.Document parseXmlFile(java.lang.String fileName, java.lang.String schemaFilePath)
Document
.
fileName
- the name of the file to parseschemaFilePath
- path to the schema file
Document
of the file fileName or null if the xml
file is not validpublic static org.w3c.dom.Document parseXmlString(java.lang.String xml)
Document
xml
- the string with xml data
Document
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |