|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.dontdrinkandroot.utils.xml.DomUtils
public class DomUtils
| Field Summary | |
|---|---|
static org.slf4j.Logger |
LOGGER
|
| Constructor Summary | |
|---|---|
protected |
DomUtils()
Disabled constructor, utility class. |
| Method Summary | |
|---|---|
protected static boolean |
checkPreconditions(org.w3c.dom.Element element)
Checks if the element is null or does only contain whitespace text. |
static java.lang.String |
getAttributeText(org.w3c.dom.Element element,
java.lang.String tagName,
java.lang.String attrName)
Get the attribute text of a single child of an element by its tag name. |
static org.w3c.dom.Element |
getChildByTagName(org.w3c.dom.Element element,
java.lang.String name)
Get a single child of an element by its tag name. |
static java.util.List<org.w3c.dom.Element> |
getChildrenByTagName(org.w3c.dom.Element element,
java.lang.String name)
Get the children of an element with a specified tag name. |
static java.lang.String |
getElementText(org.w3c.dom.Element element,
java.lang.String name)
Get the element text of a single child of an element by its tag name. |
static java.lang.Boolean |
toBoolean(org.w3c.dom.Element element)
|
static java.lang.Boolean |
toBoolean(org.w3c.dom.Element element,
java.lang.String attributeName)
|
static ISO_3166_1_alpha2 |
toCountry(org.w3c.dom.Element element)
|
static java.util.Date |
toDateFromSecondsTimestamp(org.w3c.dom.Element element,
java.lang.String attName)
|
static java.lang.Double |
toDouble(org.w3c.dom.Element element)
|
static java.lang.Double |
toDouble(org.w3c.dom.Element element,
java.lang.String attributeName)
|
static java.lang.Float |
toFloat(org.w3c.dom.Element element)
|
static java.lang.Float |
toFloat(org.w3c.dom.Element element,
java.lang.String attributeName)
|
static java.net.URL |
toHttpURL(org.w3c.dom.Element element)
|
static java.lang.Integer |
toInteger(org.w3c.dom.Element element)
|
static java.lang.Integer |
toInteger(org.w3c.dom.Element element,
java.lang.String attributeName)
|
static java.lang.Long |
toLong(org.w3c.dom.Element element)
|
static java.lang.Long |
toLong(org.w3c.dom.Element element,
java.lang.String attributeName)
|
static java.lang.String |
toNonEmptyString(org.w3c.dom.Element element)
Retrieve the element body as a string. |
static java.lang.String |
toNonEmptyString(org.w3c.dom.Element element,
java.lang.String attributeName)
|
static java.net.URI |
toURI(org.w3c.dom.Element element)
|
static java.net.URL |
toURL(org.w3c.dom.Element element)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.slf4j.Logger LOGGER
| Constructor Detail |
|---|
protected DomUtils()
| Method Detail |
|---|
public static java.lang.String toNonEmptyString(org.w3c.dom.Element element)
element - The element to process.
public static java.lang.String toNonEmptyString(org.w3c.dom.Element element,
java.lang.String attributeName)
public static java.lang.Integer toInteger(org.w3c.dom.Element element)
public static java.lang.Integer toInteger(org.w3c.dom.Element element,
java.lang.String attributeName)
public static java.lang.Long toLong(org.w3c.dom.Element element)
public static java.lang.Long toLong(org.w3c.dom.Element element,
java.lang.String attributeName)
public static java.lang.Float toFloat(org.w3c.dom.Element element)
public static java.lang.Float toFloat(org.w3c.dom.Element element,
java.lang.String attributeName)
public static java.lang.Double toDouble(org.w3c.dom.Element element)
public static java.lang.Double toDouble(org.w3c.dom.Element element,
java.lang.String attributeName)
public static java.lang.Boolean toBoolean(org.w3c.dom.Element element)
public static java.lang.Boolean toBoolean(org.w3c.dom.Element element,
java.lang.String attributeName)
public static java.net.URL toURL(org.w3c.dom.Element element)
public static java.net.URL toHttpURL(org.w3c.dom.Element element)
public static ISO_3166_1_alpha2 toCountry(org.w3c.dom.Element element)
public static java.util.Date toDateFromSecondsTimestamp(org.w3c.dom.Element element,
java.lang.String attName)
public static java.net.URI toURI(org.w3c.dom.Element element)
public static org.w3c.dom.Element getChildByTagName(org.w3c.dom.Element element,
java.lang.String name)
element - The element to search the child for.name - The tag name of the child to search.
public static java.lang.String getElementText(org.w3c.dom.Element element,
java.lang.String name)
element - The element to search the child for.name - The tag name of the child to search.
public static java.lang.String getAttributeText(org.w3c.dom.Element element,
java.lang.String tagName,
java.lang.String attrName)
element - The element to search the child for.name - The tag name of the child to search.attrName - The name of the attribute.
public static java.util.List<org.w3c.dom.Element> getChildrenByTagName(org.w3c.dom.Element element,
java.lang.String name)
element - The element to search the children for.name - The tag name of the children to search for.
protected static boolean checkPreconditions(org.w3c.dom.Element element)
element - The element to check.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||