* </pre>
* */
public class XmlSerializer implements Serializer {
public Reflections read(InputStream inputStream) {
Reflections reflections = new Reflections(new ConfigurationBuilder());
Document document;
try {
document = new SAXReader().read(inputStream);
} catch (DocumentException e) {
throw new RuntimeException(e);
}
for (Object e1 : document.getRootElement().elements()) {
Element index = (Element) e1;
for (Object e2 : index.elements()) {
Element entry = (Element) e2;
Element key = entry.element("key");
Element values = entry.element("values");
for (Object o3 : values.elements()) {
Element value = (Element) o3;
reflections.getStore().getOrCreate(index.getName()).put(key.getText(), value.getText());
}
}
}
return reflections;