|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ops4j.util.xml.ElementHelper
public final class ElementHelper
Utility class supporting the XML document parsing.
Method Summary | |
---|---|
static java.lang.String |
getAttribute(org.w3c.dom.Element node,
java.lang.String key)
Return the value of an element attribute. |
static java.lang.String |
getAttribute(org.w3c.dom.Element node,
java.lang.String key,
java.lang.String def)
Return the value of an element attribute. |
static org.w3c.dom.Element |
getChild(org.w3c.dom.Element root,
java.lang.String name)
Return a named child relative to a supplied element. |
static org.w3c.dom.Element[] |
getChildren(org.w3c.dom.Element root)
Return all children of the supplied parent. |
static org.w3c.dom.Element[] |
getChildren(org.w3c.dom.Element root,
java.lang.String name)
Return all children matching the supplied element name. |
static org.w3c.dom.Element |
getRootElement(java.io.InputStream input)
Return the root element of the supplied input stream. |
static java.lang.String |
getValue(org.w3c.dom.Element node)
Return the value of an element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.w3c.dom.Element getRootElement(java.io.InputStream input) throws javax.xml.parsers.ParserConfigurationException, java.io.IOException, org.xml.sax.SAXException
input
- the input stream containing a XML definition
java.io.IOException
- If an underlying I/O problem occured.
javax.xml.parsers.ParserConfigurationException
- if there is a severe problem in the XML parsing subsystem.
org.xml.sax.SAXException
- If the XML is malformed in some way.public static org.w3c.dom.Element getChild(org.w3c.dom.Element root, java.lang.String name)
root
- the parent DOM elementname
- the name of a child element
public static org.w3c.dom.Element[] getChildren(org.w3c.dom.Element root, java.lang.String name)
root
- the parent DOM elementname
- the name against which child element will be matched
public static org.w3c.dom.Element[] getChildren(org.w3c.dom.Element root)
root
- the parent DOM element
public static java.lang.String getValue(org.w3c.dom.Element node)
node
- the DOM node
public static java.lang.String getAttribute(org.w3c.dom.Element node, java.lang.String key)
node
- the DOM nodekey
- the attribute key
public static java.lang.String getAttribute(org.w3c.dom.Element node, java.lang.String key, java.lang.String def)
node
- the DOM nodekey
- the attribute keydef
- the default value if the attribute is undefined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |