/** * Utility method to return the value of an xsd:boolean attribute. * * @param attrs * Elements attributes to test against. * * @param attrName * Attribute name. * * @return the Boolean value if the attribute is present, or * {@code null} otherwise. * * @throws ParseException if attribute value is not valid xsd:boolean. */ public Boolean getBooleanAttribute(Attributes attrs, String attrName) throws ParseException { Boolean result = null; String value = attrs.getValue("", attrName); try { result = parseBooleanValue(value); } catch (ParseException ex) { ParseException pe = new ParseException( CoreErrorDomain.ERR.invalidAttributeValue); pe.setInternalReason("Invalid value for " + attrName + " attribute: " + value); throw pe; } return result; }
/** * Utility method to return the value of an xsd:boolean attribute. * * @param attrs * Elements attributes to test against. * * @param attrName * Attribute name. * * @return the Boolean value if the attribute is present, or * {@code null} otherwise. * * @throws ParseException if attribute value is not valid xsd:boolean. */ public Boolean getBooleanAttribute(Attributes attrs, String attrName) throws ParseException { Boolean result = null; String value = attrs.getValue("", attrName); try { result = parseBooleanValue(value); } catch (ParseException ex) { ParseException pe = new ParseException( CoreErrorDomain.ERR.invalidAttributeValue); pe.setInternalReason("Invalid value for " + attrName + " attribute: " + value); throw pe; } return result; }
/** * Utility method to return the value of an xsd:boolean attribute. * * @param attrs * Elements attributes to test against. * * @param attrName * Attribute name. * * @return the Boolean value if the attribute is present, or * {@code null} otherwise. * * @throws ParseException if attribute value is not valid xsd:boolean. */ public Boolean getBooleanAttribute(Attributes attrs, String attrName) throws ParseException { Boolean result = null; String value = attrs.getValue("", attrName); try { result = parseBooleanValue(value); } catch (ParseException ex) { ParseException pe = new ParseException( CoreErrorDomain.ERR.invalidAttributeValue); pe.setInternalReason("Invalid value for " + attrName + " attribute: " + value); throw pe; } return result; }