Don't list default values for required attributes.
@@ -202,14 +202,20 @@ public class RuleDocumentationAttribute
if (attribute == null) {
return "";
}
- StringBuilder sb = new StringBuilder()
+ StringBuilder sb =
+ new StringBuilder()
.append(TYPE_DESC.get(attribute.getType()))
- .append("; " + (attribute.isMandatory() ? "required" : "optional"))
- .append(!attribute.isConfigurable()
- ? String.format("; <a href=\"%s#configurable-attributes\">nonconfigurable</a>",
+ .append("; ")
+ .append(attribute.isMandatory() ? "required" : "optional")
+ .append(
+ !attribute.isConfigurable()
+ ? String.format(
+ "; <a href=\"%s#configurable-attributes\">nonconfigurable</a>",
RuleDocumentation.COMMON_DEFINITIONS_PAGE)
- : "")
- .append(getDefaultValue());
+ : "");
+ if (!attribute.isMandatory()) {
+ sb.append(getDefaultValue());
+ }
return sb.toString();
}
