java.lang.reflect.Array 对任意数组进行操作
private Object items;
private Collection collection;
public void setItems(Object items){
this.items = items;
if(items instanceof Collection){
collection = (Collection) items;
}
if(items instanceof Map){
Map map = (Map) items;
collection = map.entrySet();
}
if(items.getClass.isArray()){
this.collection = new ArrayList();
int length = Array.getLength(items);
for(int i = 0;i < length; i++){
Object value = Array.get(items , i);
this.collection.add(value);
}
}
}