public String getAsString(FacesContext context, UIComponent component,
Object value) throws ConverterException {
AssertionUtil.assertNotNull("FacesContext", context);
AssertionUtil.assertNotNull("UIComponent", component);
if (value == null) {
return "";
}
try {
return (value instanceof String) ? (String) value : (Integer
.toString(((Integer) value).intValue()));
} catch (Exception e) {
Object[] args = ConvertUtil.createExceptionMessageArgs(component,
value);
throw new ConverterException(FacesMessageUtil.getMessage(context,
getStringMessageId(), args), e);
}
}