|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.gs3client.data.ParseUtil
public class ParseUtil
Some useful, general response XML message parsing functions for the JavaClient's data classes.
Constructor Summary | |
---|---|
ParseUtil()
|
Method Summary | |
---|---|
static java.util.Vector |
getAllChildElementsCalled(org.w3c.dom.Element el,
java.lang.String childrenName)
|
static java.lang.String |
getBodyTextValue(org.w3c.dom.Element tag)
|
static java.util.HashMap |
getElementValuesForAttr(org.w3c.dom.Element parentEl,
java.lang.String elName,
java.lang.String attrName)
Given an Element <parentEl>, finds all direct child elements called <elName> that have an attribute named attrName: <elName attrName=value>bodytext</elName> This is particularly useful for extracting info for those cases where elName=<displayItem> and where the attrName is "name". |
static org.w3c.dom.Element |
getFirstChildElementCalled(org.w3c.dom.Element parent,
java.lang.String childElementName)
Method that returns the first child element of parent whose tagname is childElementName. |
static org.w3c.dom.Element |
getFirstDescElementCalled(org.w3c.dom.Element parent,
java.lang.String descElementName)
Method that returns the first descendant element of parent whose tagname is descElementName. |
static java.util.Vector |
getListElementsAsArray(org.w3c.dom.Element parent,
java.lang.String listElementName,
java.lang.String childElementName)
Given an xml element ('parent'), it looks through its direct children to find the <listElementName> tag and extracts each child called <childElementName> element from it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ParseUtil()
Method Detail |
---|
public static java.lang.String getBodyTextValue(org.w3c.dom.Element tag)
tag
- is the XML element from which the body text value will
be extracted.
public static java.util.Vector getAllChildElementsCalled(org.w3c.dom.Element el, java.lang.String childrenName)
el
- is the element whose child elements are returned.childrenName
- is the name of the child elements to be extracted and
returned.
public static java.util.Vector getListElementsAsArray(org.w3c.dom.Element parent, java.lang.String listElementName, java.lang.String childElementName)
parent
- is the XML element from which the specified descendant
elements are identified and returned.listElementName
- is the name of the child element of parent that we
are looking for, whose child elements will be returned.
public static org.w3c.dom.Element getFirstChildElementCalled(org.w3c.dom.Element parent, java.lang.String childElementName)
parent
- is the element whose child element (if called
childElementName) is returned.childElementName
- is the name of the child element to look for in
parent.
public static org.w3c.dom.Element getFirstDescElementCalled(org.w3c.dom.Element parent, java.lang.String descElementName)
parent
- is the element whose descendant element (if called
descElementName) is returned.descElementName
- is the name of the descendant element to look for
in parent.
public static java.util.HashMap getElementValuesForAttr(org.w3c.dom.Element parentEl, java.lang.String elName, java.lang.String attrName)
parentEl
- is the parent element whose children are searchedelName
- is the name to search for among the child elements of parentElattrName
- is the name of the attribute to look for in the child
element (of parentEl) whose tag name is elName.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |