xs.processAnnotations(AboutModel.class);
xs.addImplicitCollection(AboutModel.class, "manifests");
xs.alias("about", AboutModel.class);
// ManifestModel Xstream converter
xs.registerConverter(new Converter() {
@Override
public boolean canConvert(Class type) {
return type.equals(ManifestModel.class);
}
@Override
public void marshal(Object source, HierarchicalStreamWriter writer,
MarshallingContext context) {
ManifestModel model = (ManifestModel) source;
writer.addAttribute("name", model.getName());
for (java.util.Map.Entry<String, String> entry : model.getEntries().entrySet())
context.convertAnother(entry, new Converter() {
@Override
public boolean canConvert(Class type) {
if (java.util.Map.Entry.class.isAssignableFrom(type))
return true;