+
+ protected String getRequiredAttr(String tagName, Attributes attr, String attrName)
+ throws MissingAttributeException
+ {
+ String result = attr.getValue(attrName);
+ if (null == result) {
+ throw new MissingAttributeException(tagName, attrName);
+ }
+ return result;
+ }
+
+ protected String getOptionalAttr(Attributes attr, String attrName, String defaultValue)
+ {
+ String value = attr.getValue(attrName);
+ if (null == value) {
+ return defaultValue;
+ }
+ return value;
+ }