コード例 #1
0
 @SuppressWarnings("unchecked")
 public T[] getSelection() {
   AbstractSelect presentation = getPresentation();
   if (presentation != null) {
     Object value = presentation.getValue();
     if (value instanceof Collection<?>) {
       Collection<T> collection = (Collection<T>) value;
       selection = collection.toArray((T[]) Array.newInstance(beanType, collection.size()));
     } else {
       selection = (T[]) Array.newInstance(beanType, 1);
       selection[0] = (T) value;
     }
   }
   return selection;
 }