@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { Editor editor = (Editor) component; String value = (String) submittedValue; Converter converter = ComponentUtils.getConverter(context, component); if (converter != null) { return converter.getAsObject(context, editor, value); } return value; } }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { Converter converter = ComponentUtils.getConverter(context, component); if (converter != null) { String convertableValue = submittedValue == null ? null : submittedValue.toString(); return converter.getAsObject(context, component, convertableValue); } else { return submittedValue; } }
private Object convertValue(FacesContext context, String submittedItemValue) { Converter converter = ComponentUtils.getConverter(context, this); if (converter == null) { return submittedItemValue; } else { return converter.getAsObject(context, this, submittedItemValue); } }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { TextEditor editor = (TextEditor) component; String value = (String) submittedValue; Converter converter = ComponentUtils.getConverter(context, component); if (converter != null) { return converter.getAsObject(context, editor, value); } return value; } }
private Object convertValue(FacesContext context, String submittedItemValue) { Converter converter = ComponentUtils.getConverter(context, this); if (converter == null) { return submittedItemValue; } else { return converter.getAsObject(context, this, submittedItemValue); } } }
@SuppressWarnings("unchecked") public void populateModel(FacesContext context, String[] values, List model) { Converter converter = getConverter(); if (values != null) { for (String item : values) { if (LangUtils.isValueBlank(item)) { continue; } Object convertedValue = converter != null ? converter.getAsObject(context, this, item) : item; if (convertedValue != null) { model.add(convertedValue); } } } } }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { Chips chips = (Chips) component; if (submittedValue == null || submittedValue.equals("")) { return null; } Converter converter = ComponentUtils.getConverter(context, component); String[] values = (String[]) submittedValue; List list = new ArrayList(); for (String value : values) { if (isValueBlank(value)) { continue; } Object convertedValue = converter != null ? converter.getAsObject(context, chips, value) : value; if (convertedValue != null) { list.add(convertedValue); } } return list; } }
compareValue = converter.getAsObject(context, component, (String) compareValue);
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { String submittedValueString = (String) submittedValue; if (LangUtils.isValueBlank(submittedValueString)) { return null; } Converter converter = ComponentUtils.getConverter(context, component); if (converter != null) { return converter.getAsObject(context, component, submittedValueString); } return submittedValue; }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { AutoComplete ac = (AutoComplete) component; if (submittedValue == null || submittedValue.equals("") || ac.isMoreTextRequest(context)) { return null; } Converter converter = ComponentUtils.getConverter(context, component); if (ac.isMultiple()) { String[] values = (String[]) submittedValue; List list = new ArrayList(); for (String value : values) { if (isValueBlank(value)) { continue; } Object convertedValue = converter != null ? converter.getAsObject(context, ac, value) : value; if (convertedValue != null) { list.add(convertedValue); } } return list; } else { if (converter != null) { return converter.getAsObject(context, component, (String) submittedValue); } else { return submittedValue; } } }
@Override @SuppressWarnings("unchecked") public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { try { OrderList ol = (OrderList) component; List orderedList = new ArrayList(); Converter converter = ol.getConverter(); String[] values = (String[]) submittedValue; for (String item : values) { if (isValueBlank(item)) { continue; } Object convertedValue = converter != null ? converter.getAsObject(context, ol, item) : item; if (convertedValue != null) { orderedList.add(convertedValue); } } return orderedList; } catch (Exception exception) { throw new ConverterException(exception); } }
Object obj = calendar.getConverter().getAsObject(context, calendar, value.toString()); if (obj instanceof Date) { return (Date) obj; Object obj = converter.getAsObject(context, calendar, value.toString()); if (obj instanceof Date) { return (Date) obj;
@Override public void decode(FacesContext context, UIComponent component) { ColorPicker colorPicker = (ColorPicker) component; if (!shouldDecode(colorPicker)) { return; } String paramName = colorPicker.getClientId(context) + "_input"; Map<String, String> params = context.getExternalContext().getRequestParameterMap(); if (params.containsKey(paramName)) { String submittedValue = params.get(paramName); if (!COLOR_HEX_PATTERN.matcher(submittedValue).matches()) { return; } Converter converter = colorPicker.getConverter(); if (converter != null) { colorPicker.setSubmittedValue( converter.getAsObject(context, component, submittedValue)); } else { colorPicker.setSubmittedValue(submittedValue); } } }
Converter converter = uicalendar.getConverter(); if (converter != null) { return converter.getAsObject(context, uicalendar, submittedValue); Converter converter = context.getApplication().createConverter(type); if (converter != null) { return converter.getAsObject(context, uicalendar, submittedValue);
public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException { return converter.getAsObject(context, component, value); }
private Object convertValue(FacesContext context, String submittedItemValue) { Converter converter = ComponentUtils.getConverter(context, this); if(converter == null) return submittedItemValue; else return converter.getAsObject(context, this, submittedItemValue); }
@Override public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException { TextEditor editor = (TextEditor) component; String value = (String) submittedValue; Converter converter = ComponentUtils.getConverter(context, component); if (converter != null) { return converter.getAsObject(context, editor, value); } return value; } }
private Object convertValue(FacesContext context, String submittedItemValue) { Converter converter = ComponentUtils.getConverter(context, this); if(converter == null) return submittedItemValue; else return converter.getAsObject(context, this, submittedItemValue); } public String resolveWidgetVar() {
@Override public Object getConvertedValue(FacesContext fc, UIComponent c, Object sval) throws ConverterException { Converter cnv = resolveConverter(fc, c, sval); if (cnv != null) { return cnv.getAsObject(fc, c, (String) sval); } else { cnv = new DoubleConverter(); return cnv.getAsObject(fc, c, (String) sval); } }
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) { return _getDelegate().getAsObject(facesContext, component, value); }