List of utility methods to do XML Attribute from Element
int | getIntAttribute(Element element, String name, int defaultValue) Get the value of an attribute of the given element with the given name as an integer, or return the given default value if the attribute is missing or not parseable as an integer. String s = element.getAttribute(name); if (s != null) { try { return Integer.parseInt(s); } catch (NumberFormatException e) { return defaultValue; ... |
Integer | getIntAttribute(NamedNodeMap namedNodeMap, String name) get Int Attribute String value = getAttribute(namedNodeMap, name); if (value == null) { return null; } else { return Integer.valueOf(value); |
int | getIntAttributeIgnoreCase(Element ele, String attr, int defaultvalue) get Int Attribute Ignore Case if (ele == null) { return defaultvalue; String attrvalue = getAttributeIgnoreCase(ele, attr); if (attrvalue == null) { return defaultvalue; try { ... |
int | getIntAttributeValue(Element element, String attribute) get Int Attribute Value int ret; Attr attr = element.getAttributeNode(attribute); try { ret = Integer.valueOf(attr.getValue()); } catch (NumberFormatException e) { ret = 0; return ret; ... |
int | getInteger(final org.w3c.dom.Element element, final String attr, int def) Returns the integer value of the given XML attribute; or the default value. if (element.getAttributeNode(attr) == null) return def; try { return Integer.parseInt(element.getAttribute(attr).trim()); } catch (NumberFormatException e) { return def; |
int | getIntegerAttribute(Element el, String attribute) get Integer Attribute String attributeValue = el.getAttribute(attribute); try { return Integer.parseInt(attributeValue); } catch (NumberFormatException e) { return -1; |
int | getIntegerAttribute(Element element, String name) get Integer Attribute return Integer.parseInt(getAttribute(element, name));
|
String | getStringAttr(Element element, String name, String def) get String Attr String attr = element.getAttribute(name); if (attr.isEmpty()) { attr = def; return attr; |
String | getStringAttribute(Element e, String name, String def) get String Attribute String r = e.getAttribute(name); if (r == null || "".equals(r.trim())) r = def; return r; |
String | getStringAttribute(Element el, String attribute) get String Attribute return el.getAttribute(attribute);
|