@Override
public void retargetMethodExpressions(FacesContext context, UIComponent topLevelComponent)
{
checkNull(context, "context");
BeanInfo compositeComponentMetadata
= (BeanInfo) topLevelComponent.getAttributes().get(UIComponent.BEANINFO_KEY);
if (compositeComponentMetadata == null)
{
log.severe("Composite component metadata not found for: " + topLevelComponent.getClientId());
return;
}
// "...For each attribute that is a MethodExpression..." This means we have to scan
// all attributes with "method-signature" attribute and no "type" attribute
// javax.faces.component._ComponentAttributesMap uses BeanInfo.getPropertyDescriptors to
// traverse over it, but here the metadata returned by UIComponent.BEANINFO_KEY is available
// only for composite components.
// That means somewhere we need to create a custom BeanInfo object for composite components
// that will be filled somewhere (theorically in ViewDeclarationLanguage.getComponentMetadata())
PropertyDescriptor[] propertyDescriptors = compositeComponentMetadata.getPropertyDescriptors();
ELContext elContext = (ELContext) context.getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
for (PropertyDescriptor propertyDescriptor : propertyDescriptors)
{