@Override
    public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
        if (!name.equals(this.methodName)) {
            return null;
        }

        Class<?> type = meta.getPropertyType(name);

        if (MethodExpression.class.equals(type)) {
            Method method = meta.getWriteMethod(name);
            if (method != null) {
                return new MethodExpressionMetadata(method, attribute, this.returnTypeClass, this.params);
            }
        }

        return null;
    }
Optional Rule for binding Method[Binding|Expression] properties

@author Mike Kienenberger
@author Jacob Hookom

Implementation copied from Facelets 1.1.14, as it got hidden by JSF 2.0
primefaces/src/main/java/org/primefaces/facelets/MethodRule.java