提交 247a9dd6 编写于 作者: K Kohsuke Kawaguchi

added another form of the overloaded method.

上级 5cf623cf
......@@ -783,9 +783,17 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
List<T> items = new ArrayList<T>();
if(!formData.has(key)) return items;
JSONArray a = JSONArray.fromObject(formData.get(key));
for (Object o : a) {
return newInstancesFromHeteroList(req,formData.get(key),descriptors);
}
public static <T extends Describable<T>>
List<T> newInstancesFromHeteroList(StaplerRequest req, Object formData,
Collection<? extends Descriptor<T>> descriptors) throws FormException {
List<T> items = new ArrayList<T>();
for (Object o : JSONArray.fromObject(formData)) {
JSONObject jo = (JSONObject)o;
String kind = jo.getString("kind");
items.add(find(descriptors,kind).newInstance(req,jo));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册