|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.maximo.util.Dom
public final class Dom
This class consists exclusively of static methods that operate on or return XML content and DOM elements.
Constructor Summary | |
---|---|
Dom()
|
Method Summary | |
---|---|
static java.util.Map<java.lang.String,java.lang.String> |
getAttributes(org.w3c.dom.Node rootNode)
Returns a map containing the child nodes found in the given
XML node. |
static java.util.Map<java.lang.String,java.lang.String> |
getAttributes(org.w3c.dom.Node rootNode,
java.util.Set<java.lang.String> names)
Searches the specified XML node for child nodes with the specified names. |
static java.lang.String |
getAttributeValue(org.w3c.dom.Node node,
java.lang.String attributeName)
Returns the value of the specified attribute. |
static org.w3c.dom.NodeList |
getElements(java.lang.String elementName,
org.w3c.dom.Document document)
Returns all elements specified by elementName. |
static org.w3c.dom.NodeList |
getElements(java.lang.String elementName,
java.lang.String xml)
Parses the XML content and returns all elements specified by elementName. |
static java.lang.String |
getTextValue(org.w3c.dom.Node node)
Returns the text value of the specified XML node. |
static boolean |
isNull(org.w3c.dom.Node node)
Indicates if the specified XML node has null value. |
static org.w3c.dom.Document |
parse(java.lang.String xml)
Parses the XML content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Dom()
Method Detail |
---|
public static java.util.Map<java.lang.String,java.lang.String> getAttributes(org.w3c.dom.Node rootNode)
map
containing the child nodes found in the given
XML node.
rootNode
- XML node whose child nodes are to be returned
map
containing the child nodes found in the given XML
nodepublic static java.util.Map<java.lang.String,java.lang.String> getAttributes(org.w3c.dom.Node rootNode, java.util.Set<java.lang.String> names)
rootNode
- XML node whose child nodes are to be returnednames
- names of the attributes to be found
map
containing the child nodes found and its
respective valuespublic static java.lang.String getAttributeValue(org.w3c.dom.Node node, java.lang.String attributeName)
node
- node containing the specified attributeattributeName
- attribute's name
null
if the
attribute does not existpublic static org.w3c.dom.NodeList getElements(java.lang.String elementName, org.w3c.dom.Document document)
elementName
- name of the element to be returneddocument
- DOM document
public static org.w3c.dom.NodeList getElements(java.lang.String elementName, java.lang.String xml) throws MxConnXmlParsingException
elementName
- name of the element to be returnedxml
- XML content to be parsed
MxConnXmlParsingException
- if it is not possible to parse the XML contentpublic static java.lang.String getTextValue(org.w3c.dom.Node node)
node
- XML node
public static boolean isNull(org.w3c.dom.Node node)
null
value. NOTE:
Not used.
node
- XML node
true
if the specified XML node has null
value, otherwise false
public static org.w3c.dom.Document parse(java.lang.String xml) throws MxConnXmlParsingException
xml
- XML content to be parsed
MxConnXmlParsingException
- if it is not possible to parse the XML content
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |