|
||||||||||
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 String |
getAttribute(Element node,
String key)
Return the value of an element attribute. |
static String |
getAttribute(Element node,
String key,
String def)
Return the value of an element attribute. |
static Element |
getChild(Element root,
String name)
Return a named child relative to a supplied element. |
static Element[] |
getChildren(Element root)
Return all children of the supplied parent. |
static Element[] |
getChildren(Element root,
String name)
Return all children matching the supplied element name. |
static Element |
getRootElement(InputStream input)
Return the root element of the supplied input stream. |
static String |
getValue(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 Element getRootElement(InputStream input) throws ParserConfigurationException, IOException, SAXException
input
- the input stream containing a XML definition
IOException
- If an underlying I/O problem occurred.
ParserConfigurationException
- if there is a severe problem in the XML parsing subsystem.
SAXException
- If the XML is malformed in some way.public static Element getChild(Element root, String name)
root
- the parent DOM elementname
- the name of a child element
public static Element[] getChildren(Element root, String name)
root
- the parent DOM elementname
- the name against which child element will be matched
public static Element[] getChildren(Element root)
root
- the parent DOM element
public static String getValue(Element node)
node
- the DOM node
public static String getAttribute(Element node, String key)
node
- the DOM nodekey
- the attribute key
public static String getAttribute(Element node, String key, 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 |