Source:
public CatalogXmlSerializer() { xstream.addDefaultImplementation(ArrayList.class, Collection.class); xstream.aliasType("list", List.class); xstream.aliasType("map", Map.class); xstream.useAttributeFor("id", String.class); xstream.aliasType("catalog", CatalogDto.class); xstream.useAttributeFor(CatalogDto.class, "url"); xstream.addImplicitCollection(CatalogDto.class, "catalogs", CatalogDto.class); xstream.addImplicitCollection(CatalogDto.class, "entries", CatalogTemplateItemDto.class); xstream.addImplicitCollection(CatalogDto.class, "entries", CatalogEntityItemDto.class); xstream.addImplicitCollection(CatalogDto.class, "entries", CatalogPolicyItemDto.class); xstream.aliasType("template", CatalogTemplateItemDto.class); xstream.aliasType("entity", CatalogEntityItemDto.class); xstream.aliasType("policy", CatalogPolicyItemDto.class); xstream.aliasAttribute(CatalogItemDtoAbstract.class, "javaType", "type"); xstream.aliasAttribute(CatalogItemDtoAbstract.class, "displayName", "name"); xstream.useAttributeFor(CatalogItemDtoAbstract.class, "version"); xstream.useAttributeFor(CatalogClasspathDto.class, "scan"); xstream.addImplicitCollection(CatalogClasspathDto.class, "entries", "entry", String.class); xstream.registerConverter(new EnumCaseForgivingSingleValueConverter(CatalogScanningModes.class)); xstream.aliasType("libraries", CatalogLibrariesDto.class); xstream.addImplicitCollection(CatalogLibrariesDto.class, "bundles", "bundle", CatalogBundleDto.class); xstream.omitField(AbstractBrooklynObject.class, "managementContext"); xstream.omitField(AbstractBrooklynObject.class, "_legacyConstruction"); xstream.omitField(AbstractBrooklynObject.class, "hasWarnedOfNoManagementContextWhenPersistRequested"); }

Target:
public CatalogXmlSerializer() { xstream.addDefaultImplementation(ArrayList.class, Collection.class); xstream.aliasType("list", List.class); xstream.aliasType("map", Map.class); xstream.useAttributeFor("id", String.class); xstream.aliasType("catalog", CatalogDto.class); xstream.useAttributeFor(CatalogDto.class, "url"); xstream.addImplicitCollection(CatalogDto.class, "catalogs", CatalogDto.class); xstream.addImplicitCollection(CatalogDto.class, "entries", CatalogTemplateItemDto.class); xstream.addImplicitCollection(CatalogDto.class, "entries", CatalogEntityItemDto.class); xstream.addImplicitCollection(CatalogDto.class, "entries", CatalogPolicyItemDto.class); xstream.aliasType("template", CatalogTemplateItemDto.class); xstream.aliasType("entity", CatalogEntityItemDto.class); xstream.aliasType("policy", CatalogPolicyItemDto.class); xstream.aliasField("registeredType", CatalogItemDtoAbstract.class, "symbolicName"); xstream.aliasAttribute(CatalogItemDtoAbstract.class, "displayName", "name"); xstream.useAttributeFor(CatalogItemDtoAbstract.class, "type"); xstream.useAttributeFor(CatalogItemDtoAbstract.class, "version"); xstream.aliasType("bundle", CatalogBundleDto.class); xstream.registerConverter(new CatalogBundleConverter(xstream.getMapper(), xstream.getReflectionProvider())); xstream.useAttributeFor(CatalogClasspathDto.class, "scan"); xstream.addImplicitCollection(CatalogClasspathDto.class, "entries", "entry", String.class); xstream.registerConverter(new EnumCaseForgivingSingleValueConverter(CatalogScanningModes.class)); xstream.omitField(AbstractBrooklynObject.class, "managementContext"); xstream.omitField(AbstractBrooklynObject.class, "_legacyConstruction"); xstream.omitField(AbstractBrooklynObject.class, "hasWarnedOfNoManagementContextWhenPersistRequested"); }