|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.filenet.wcm.toolkit.server.util.xml.XMLNodeUtil
XML utility class that does NOT use xpath to retirve node data. Instead it uses a basic tag name look up scheme and uses the the standard chaild Node iterators provider with the Node object implementation.
Constructor Summary | |
XMLNodeUtil()
|
Method Summary | |
protected static void |
addChildren(java.util.ArrayList childList,
org.w3c.dom.Node parent,
java.lang.String nameToFind)
Helper method to add any child nodes that match the passed in tag name to the child list. |
static java.lang.String |
getCDATANodeText(org.w3c.dom.Node node)
Helper method to get the text value of a specified CDATA node. |
static java.util.ArrayList |
getChildList(org.w3c.dom.Node parent,
java.lang.String nameToFind)
Helper method to retrieve an array list of children under a parent node. |
static org.w3c.dom.Node |
getChildNode(org.w3c.dom.Node parent,
java.lang.String nameToFind)
Helper method to find a child node under a parent. |
static java.lang.String |
getChildNodeText(org.w3c.dom.Node parent,
java.lang.String nameToFind)
Helper method to find a child node under a parent and return it's text value. |
static org.w3c.dom.Node |
getChildNodeWithAttrValue(java.util.ArrayList childList,
java.lang.String nameToFind,
java.lang.String valueToFind)
Helper method to find a child node in a list of node that has an attribute with a particular value. |
static org.w3c.dom.Node |
getChildNodeWithValue(java.util.ArrayList childList,
java.lang.String nameToFind,
java.lang.String valueToFind)
Helper method to find a child node in a list of node that has a particular value. |
static java.lang.String |
getNodeText(org.w3c.dom.Node node)
Helper method to get the text value of a specified node. |
static org.w3c.dom.Node |
getSelectNode(org.w3c.dom.Node parent,
java.lang.String pathToNode)
Helper method to find a child node under a parent. |
static java.util.ArrayList |
getSelectNodeList(org.w3c.dom.Node parent,
java.lang.String pathToNode)
Helper method to retrieve an array list of children under a parent node. |
static void |
setNodeText(org.w3c.dom.Node node,
java.lang.String value)
Helper method to set the text value of a specified node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLNodeUtil()
Method Detail |
public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node parent, java.lang.String nameToFind) throws java.lang.Exception
parent
- Node holding the parentnameToFind
- String holding the XML element tag name to look for under the parent node.
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.public static org.w3c.dom.Node getSelectNode(org.w3c.dom.Node parent, java.lang.String pathToNode) throws java.lang.Exception
parent
- Node holding the parentpathToNode
- String holding simple XML tag path (ie: "propdesc/symname"). Does not
use xpath, and therfore does not handle queries (ie: "propdesc[symname = 'myprop'].
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.public static java.util.ArrayList getChildList(org.w3c.dom.Node parent, java.lang.String nameToFind) throws java.lang.Exception
parent
- Node holding the parentnameToFind
- String holding the XML element tag name to look for under the parent node.
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.protected static void addChildren(java.util.ArrayList childList, org.w3c.dom.Node parent, java.lang.String nameToFind)
childList
- ArrayList holding the current list of childrenparent
- Node to for children thath match the specified tag.nameToFind
- String holding XML element name to look for.public static java.util.ArrayList getSelectNodeList(org.w3c.dom.Node parent, java.lang.String pathToNode) throws java.lang.Exception
parent
- Node holding the parentpathToNode
- String holding simple XML tag path (ie: "propdesc/symname"). Does not
use xpath, and therfore does not handle queries (ie: "propdesc[symname = 'myprop'].
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.public static org.w3c.dom.Node getChildNodeWithValue(java.util.ArrayList childList, java.lang.String nameToFind, java.lang.String valueToFind) throws java.lang.Exception
childList
- ArrayList holding the child node to look throughnameToFind
- String holding the XML element tag name to look for under the parent node.valueToFind
- String holding the XML element value to look for under the child node mathcing the name.
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.public static org.w3c.dom.Node getChildNodeWithAttrValue(java.util.ArrayList childList, java.lang.String nameToFind, java.lang.String valueToFind) throws java.lang.Exception
childList
- ArrayList holding the child node to look throughnameToFind
- String holding the XML attribute tag name to look for under the parent node.valueToFind
- String holding the XML attribute value to look for under the child node mathcing the name.
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.public static java.lang.String getNodeText(org.w3c.dom.Node node)
node
- Node object to find value
public static java.lang.String getCDATANodeText(org.w3c.dom.Node node)
node
- Node object to find value
public static java.lang.String getChildNodeText(org.w3c.dom.Node parent, java.lang.String nameToFind) throws java.lang.Exception
parent
- Node holding the parentnameToFind
- String holding the XML element tag name to look for under the parent node.
java.lang.Exception
- If there are problems retrieving data or with an invalid parameter.public static void setNodeText(org.w3c.dom.Node node, java.lang.String value)
node
- Node object to set value onvalue
- String text value to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |