示例#1
0
 public static Object getConvertedUIOutputValues(
     final FacesContext context, final UIOutput output, final Object submittedValue) {
   if (submittedValue == null) {
     return null;
   }
   final Converter converter = findConverter(context, output);
   if (converter == null) {
     return submittedValue;
   }
   final int length = Array.getLength(submittedValue);
   final Class valueType = getValueType(context, output);
   final Object ret = Array.newInstance(valueType, length);
   for (int i = 0; i < length; ++i) {
     final Object target = Array.get(submittedValue, i);
     final String value = (target instanceof String) ? (String) target : null;
     final Object o = converter.getAsObject(context, output, value);
     ArrayUtil.setArrayValue(ret, valueType, o, i);
   }
   return ret;
 }
 private boolean isSelected(final String[] selectedValues, final String value) {
   return ArrayUtil.contains(selectedValues, value);
 }