public static void setConverter(ValueHolder valueHolder, String converterId) {
if (converterId != null && valueHolder.getConverter() == null) {
final FacesContext facesContext = FacesContext.getCurrentInstance();
final Application application = facesContext.getApplication();
if (UIComponentTag.isValueReference(converterId)) {
ValueBinding valueBinding = application.createValueBinding(converterId);
if (valueHolder instanceof UIComponent) {
((UIComponent) valueHolder).setValueBinding(Attributes.CONVERTER, valueBinding);
}
} else {
Converter converter = application.createConverter(converterId);