Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这样的结构:
Hashtable<String, ArrayList<Hashtable<Integer, Integer>>> complexTable
我想用 JAXB 编组这个。我想我应该为此编写一个适配器,但我不知道这个适配器应该是什么样子。有人可以帮我吗?
我不清楚你想做什么。您有上述对象的架构吗?您是否查看过 JAXB 非官方指南,尤其是编组部分?
如果您没有架构,并且只需将上述内容作为 XML 保存,您是否想要/需要使用 JAXB ?相反,您可能对XStream感兴趣。它将在不需要模式的情况下将 POJO(普通的旧 Java 对象)序列化/反序列化到 XML 或从 XML 序列化。它将轻松处理上述情况。