YamlConstructor.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:Thermos-Bukkit 作者:
@Override
public Object construct(Node node) {
    if (node.isTwoStepsConstruction()) {
        throw new YAMLException("Unexpected referential mapping structure. Node: " + node);
    }

    Map<?, ?> raw = (Map<?, ?>) super.construct(node);

    if (raw.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) {
        Map<String, Object> typed = new LinkedHashMap<String, Object>(raw.size());
        for (Map.Entry<?, ?> entry : raw.entrySet()) {
            typed.put(entry.getKey().toString(), entry.getValue());
        }

        try {
            return ConfigurationSerialization.deserializeObject(typed);
        } catch (IllegalArgumentException ex) {
            throw new YAMLException("Could not deserialize object", ex);
        }
    }

    return raw;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号