protected void addAttribute(
final ExecutableElement executableElement, final List<org.jdom.Element> attributes,
final List<org.jdom.Element> properties,
final Namespace namespace) {
final UIComponentTagAttribute componentAttribute = executableElement.getAnnotation(UIComponentTagAttribute.class);
if (componentAttribute != null) {
final String simpleName = executableElement.getSimpleName().toString();
if (simpleName.startsWith("set")) {
final String name = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
if (IGNORED_PROPERTIES.contains(name)) {
final org.jdom.Element attribute = new org.jdom.Element(ATTRIBUTE, namespace);
final org.jdom.Element attributeName = new org.jdom.Element(ATTRIBUTE_NAME, namespace);
final org.jdom.Element attributeClass = new org.jdom.Element(ATTRIBUTE_CLASS, namespace);
attributeName.setText(name);
addClass(componentAttribute, attributeClass);
addDescription(executableElement, attribute, namespace);
attribute.addContent(attributeName);
attribute.addContent(attributeClass);
if (componentAttribute.defaultValue().length() > 0) {
final org.jdom.Element defaultValue = new org.jdom.Element(DEFAULT_VALUE, namespace);
defaultValue.setText(componentAttribute.defaultValue());
attribute.addContent(defaultValue);
}
attribute.addContent(createPropertyOrAttributeExtension(ATTRIBUTE_EXTENSION, executableElement,
componentAttribute, namespace));
attributes.add(attribute);
} else {
final org.jdom.Element property = new org.jdom.Element(PROPERTY, namespace);
final org.jdom.Element propertyName = new org.jdom.Element(PROPERTY_NAME, namespace);
final org.jdom.Element propertyClass = new org.jdom.Element(PROPERTY_CLASS, namespace);
propertyName.setText(name);
addClass(componentAttribute, propertyClass);
addDescription(executableElement, property, namespace);
property.addContent(propertyName);
property.addContent(propertyClass);
if (componentAttribute.defaultValue().length() > 0) {
final org.jdom.Element defaultValue = new org.jdom.Element(DEFAULT_VALUE, namespace);
defaultValue.setText(componentAttribute.defaultValue());
property.addContent(defaultValue);
}
property.addContent(
createPropertyOrAttributeExtension(PROPERTY_EXTENSION, executableElement, componentAttribute, namespace));