/**
* DeSerializes the given dataSource to an array
*
* @param clazz type of the object
* @param dataSource dataSource like map or fileConfiguration
* @param <T> type of the object
* @return deSerialized array
* @throws InstantiationException exception
* @throws IllegalAccessException exception
*/
public static <T> T[] deserializeArray(Class<T> clazz, Object dataSource) throws InstantiationException, IllegalAccessException {
final Map<String, Object> data = getDataFromSource(dataSource);
final T[] objects = (T[]) Array.newInstance(clazz, data.size());
int i = 0;
for (final String key : data.keySet()) {
objects[i] = deserializeObject(clazz, ((MemorySection) data.get(key)).getValues(false));
i++;
}
return objects;
}
YamlSerializer.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:BlockBall
作者:
评论列表
文章目录