List of utility methods to do XML Attribute Get
boolean | getBooleanAttribute(Element el, String name) get Boolean Attribute String s = el.getAttribute(name); if (s == null || "0".equals(s)) { return false; if ("1".equals(s)) { return true; return new Boolean(s).booleanValue(); ... |
boolean | getBooleanAttribute(Element elem, String attName, boolean mandatory) getBooleanAttribute purpose. String value = getAttribute(elem, attName, mandatory);
return Boolean.valueOf(value).booleanValue();
|
boolean | getBooleanAttribute(Element elem, String attName, boolean mandatory, boolean defaultValue) getBooleanAttribute purpose. String value = getAttribute(elem, attName, mandatory); if ((value == null) || (value == "")) { return defaultValue; return Boolean.valueOf(value).booleanValue(); |
boolean | getBooleanAttribute(Element element, String attributeName) Determines whether a specific boolean flag is set on an element. String value = element.getAttribute(attributeName); if (value == null) { return false; } else if (value.equals("true")) { return true; } else { return false; |
boolean | getBooleanAttribute(Element element, String key, boolean defValue) get Boolean Attribute String v = element.getAttribute(key);
return v.length() == 0 ? defValue : Boolean.parseBoolean(v);
|
boolean | getBooleanAttribute(Element element, String name) get Boolean Attribute return Boolean.parseBoolean(getAttribute(element, name));
|
boolean | getBooleanAttribute(Element element, String name, boolean defaultValue) Get the value of an attribute of the given element with the given name as a boolean, or return the given default value if the attribute is missing or not parseable as a boolean. String s = element.getAttribute(name); if (s != null) return Boolean.parseBoolean(s); return defaultValue; |
Boolean | getBooleanAttribute(Node n, String attributeName) get Boolean Attribute Node attrib = n.getAttributes().getNamedItem(attributeName); if (attrib == null) return null; String value = attrib.getNodeValue(); assert (value != null); return new Boolean(value); |
boolean | getBooleanAttribute(Node targetElem, String keyName, boolean defaultValue) get Boolean Attribute String enabledStr = getAttribute(targetElem, keyName, null); if (enabledStr == null) { return defaultValue; return Boolean.parseBoolean(enabledStr); |
boolean | getBooleanAttributeByName(Node content, String attributeName, boolean defaultTrue) get Boolean Attribute By Name String value = getAttributeByName(content, attributeName); if (defaultTrue) { return (value == null) || (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes")); } else { return (value != null) && (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes")); |