@Override public String getAsString(FacesContext facesContext, UIComponent component, Object object) { if (object == null) { return null; } if (object instanceof Cure) { Cure o = (Cure) object; return getStringKey(o.getId()); } else { Logger.getLogger(this.getClass().getName()) .log( Level.SEVERE, "object {0} is of type {1}; expected type: {2}", new Object[] {object, object.getClass().getName(), Cure.class.getName()}); return null; } }