if (simpleName.startsWith("set") || simpleName.startsWith("get")) {
String name = simpleName.substring(3, 4).toLowerCase(Locale.ENGLISH) + simpleName.substring(4);
if (ignoredProperties.contains(name)) {
return;
}
PropertyInfo propertyInfo = new PropertyInfo(name);
propertyInfo.setAllowedValues(uiComponentTagAttribute.allowedValues());
if (tagAttribute != null) {
propertyInfo.setBodyContent(tagAttribute.bodyContent());
propertyInfo.setTagAttribute(true);
}
String type;
if (uiComponentTagAttribute.expression().isMethodExpression()) {
propertyInfo.setMethodExpressionRequired(true);
type = "javax.faces.el.MethodBinding";
} else if (uiComponentTagAttribute.expression() == DynamicExpression.VALUE_BINDING_REQUIRED) {
propertyInfo.setValueExpressionRequired(true);
if (uiComponentTagAttribute.type().length > 1) {
type = "java.lang.Object";
} else {
type = uiComponentTagAttribute.type()[0];
}
} else if (uiComponentTagAttribute.type().length == 1) {
if (uiComponentTagAttribute.expression() == DynamicExpression.PROHIBITED) {
propertyInfo.setLiteralOnly(true);
}
type = uiComponentTagAttribute.type()[0];
} else {
throw new IllegalArgumentException(
"Type should be single argument " + Arrays.toString(uiComponentTagAttribute.type()));
}
propertyInfo.setType(type);
propertyInfo.setDefaultValue(
uiComponentTagAttribute.defaultValue().length() > 0 ? uiComponentTagAttribute.defaultValue() : null);
propertyInfo.setDefaultCode(
uiComponentTagAttribute.defaultCode().length() > 0 ? uiComponentTagAttribute.defaultCode() : null);
propertyInfo.setMethodSignature(uiComponentTagAttribute.methodSignature());
propertyInfo.setDeprecated(declaration.getAnnotation(Deprecated.class) != null);
propertyInfo.setDescription(getDescription(declaration));
if (properties.containsKey(name)) {
getEnv().getMessager().printWarning("Redefinition of attribute '" + name + "'.");
}
properties.put(name, propertyInfo);
}