}
protected void addAttribute(
final ExecutableElement element, final Element tagElement, final Document document, final Type type)
throws ClassNotFoundException {
final TagAttribute tagAttribute = element.getAnnotation(TagAttribute.class);
if (tagAttribute != null) {
final String simpleName = element.getSimpleName().toString();
if (simpleName.startsWith("set") || simpleName.startsWith("get")) {
final Element attribute = document.createElement("attribute");
String attributeName = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
if (tagAttribute.name().length() > 0) {
attributeName = tagAttribute.name();
}
checkAttributeDuplicates(attributeName);
addDescription(element, attribute, document, false);
addLeafTextElement(attributeName, "name", attribute, document);
addLeafTextElement(Boolean.toString(tagAttribute.required()), "required", attribute, document);
final UIComponentTagAttribute componentTagAttribute = element.getAnnotation(UIComponentTagAttribute.class);
type.addAttributeType(attribute, tagAttribute, componentTagAttribute, document, attributeName);
tagElement.appendChild(attribute);
} else {
throw new IllegalArgumentException("Only setter allowed found: " + simpleName);