public static Converter<?> getConverter(FacesContext context, UIComponent component) {
        if (!(component instanceof ValueHolder)) {
            return null;
        }

        Converter<?> converter = ((ValueHolder) component).getConverter();
        if (converter != null) {
            return converter;
        }

        ValueExpression valueExpression = component.getValueExpression("value");
        if (valueExpression == null) {
            return null;
        }

        Class<?> converterType = valueExpression.getType(context.getELContext());
        return getConverter(context, converterType);
    }
Finds appropriate converter for a given value holder

@param context   FacesContext instance
@param component ValueHolder instance to look up converter for
@return          Converter
primefaces/src/main/java/org/primefaces/util/ComponentUtils.java