@Override
public Object read(String key, ConfigurationSection section) {
List<?> list;
if (section.isConfigurationSection(key)) {
list = new ArrayList<>(section.getConfigurationSection(key).getValues(false).values());
} else {
list = section.getList(key);
}
Object array = Array.newInstance(type, list.size());
for (int i = 0; i < list.size(); i++) {
Object obj = list.get(i);
ConfigurationSection dummySection = new MemoryConfiguration();
dummySection.set("dummy", obj);
Array.set(array, i, handler.adaptIn(dummySection, "dummy", obj.getClass()));
}
return array;
}
ArrayAdapter.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:ConfigAPI
作者:
评论列表
文章目录