public static int parseOptionalBoundedIntAttr(Element ele, String attrName, int defaultValue,
			int minValue, int maxValue) throws NumberFormatException {
		String value = ele.getAttributeValue(attrName);
		if (value == null) {
			return defaultValue;
		}
		try {
			return parseBoundedInt(value, minValue, maxValue);
		}
		catch (NumberFormatException nfe) {
			throw new NumberFormatException("Attribute '" + attrName + "' bad value: " +
				nfe.getMessage() + " in " + toString(ele));
		}
	}
Parses an optional attribute as a decimal number, returning its integer
value, or the defaultValue if the attribute is null.

@param ele JDOM element that contains the attribute.
@param attrName the name of the xml attribute to parse.
@param defaultValue the default value to return if attribute is missing.
@param minValue minimum value allowed (inclusive).
@param maxValue maximum value allowed (inclusive).
@return integer value of the attribute.
@throws NumberFormatException if the attribute value could not be parsed
            or is out of range.
Ghidra/Framework/Generic/src/main/java/ghidra/util/xml/XmlUtilities.java