public final class XmlHelper
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.Iterator |
getChildrenByTagName(org.w3c.dom.Element element,
java.lang.String tagName)
Returns an iterator over the children of the given element with
the given tag name.
|
static java.lang.String |
getElementContent(org.w3c.dom.Element element)
Get the content of the given element.
|
static java.lang.String |
getElementContent(org.w3c.dom.Element element,
java.lang.String defaultStr)
Get the content of the given element.
|
static org.w3c.dom.Element |
getOptionalChild(org.w3c.dom.Element element,
java.lang.String tagName)
Gets the child of the specified element having the
specified name.
|
static org.w3c.dom.Element |
getOptionalChild(org.w3c.dom.Element element,
java.lang.String tagName,
org.w3c.dom.Element defaultElement)
Gets the child of the specified element having the
specified name.
|
static boolean |
getOptionalChildBooleanContent(org.w3c.dom.Element element,
java.lang.String name) |
static java.lang.String |
getOptionalChildContent(org.w3c.dom.Element element,
java.lang.String tagName)
Macro to get the content of an optional child element.
|
static org.w3c.dom.Element |
getUniqueChild(org.w3c.dom.Element element,
java.lang.String tagName)
Gets the child of the specified element having the specified unique
name.
|
static java.lang.String |
getUniqueChildContent(org.w3c.dom.Element element,
java.lang.String tagName)
Macro to get the content of a unique child element.
|
public static java.util.Iterator getChildrenByTagName(org.w3c.dom.Element element,
java.lang.String tagName)
element - The parent elementtagName - The name of the desired childpublic static org.w3c.dom.Element getUniqueChild(org.w3c.dom.Element element,
java.lang.String tagName)
throws java.lang.Exception
element - The parent elementtagName - The name of the desired childjava.lang.Exception - Child was not found or was not unique.public static org.w3c.dom.Element getOptionalChild(org.w3c.dom.Element element,
java.lang.String tagName)
throws java.lang.Exception
element - the parent elementtagName - the name of the desired childjava.lang.Exceptionpublic static org.w3c.dom.Element getOptionalChild(org.w3c.dom.Element element,
java.lang.String tagName,
org.w3c.dom.Element defaultElement)
throws java.lang.Exception
element - the parent elementtagName - the name of the desired childdefaultElement - the element to return if the child
doesn't existjava.lang.Exceptionpublic static java.lang.String getElementContent(org.w3c.dom.Element element)
throws java.lang.Exception
element - The element to get the content for.java.lang.Exceptionpublic static java.lang.String getElementContent(org.w3c.dom.Element element,
java.lang.String defaultStr)
throws java.lang.Exception
element - The element to get the content for.defaultStr - The default to return when there is no content.java.lang.Exceptionpublic static java.lang.String getUniqueChildContent(org.w3c.dom.Element element,
java.lang.String tagName)
throws java.lang.Exception
element - The parent element.tagName - The name of the desired child.java.lang.Exceptionpublic static java.lang.String getOptionalChildContent(org.w3c.dom.Element element,
java.lang.String tagName)
throws java.lang.Exception
element - The parent element.tagName - The name of the desired child.java.lang.Exceptionpublic static boolean getOptionalChildBooleanContent(org.w3c.dom.Element element,
java.lang.String name)
throws java.lang.Exception
java.lang.ExceptionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.