| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
package org.apache.shindig.social.core.util.xstream; |
| 19 | |
|
| 20 | |
import com.google.common.collect.Lists; |
| 21 | |
import com.google.common.collect.Maps; |
| 22 | |
|
| 23 | |
import com.google.inject.Inject; |
| 24 | |
import com.google.inject.Injector; |
| 25 | |
|
| 26 | |
import com.thoughtworks.xstream.XStream; |
| 27 | |
import com.thoughtworks.xstream.converters.Converter; |
| 28 | |
import com.thoughtworks.xstream.converters.extended.ISO8601DateConverter; |
| 29 | |
import com.thoughtworks.xstream.converters.extended.ISO8601GregorianCalendarConverter; |
| 30 | |
import com.thoughtworks.xstream.converters.extended.ISO8601SqlTimestampConverter; |
| 31 | |
import com.thoughtworks.xstream.converters.reflection.ReflectionProvider; |
| 32 | |
import com.thoughtworks.xstream.io.HierarchicalStreamDriver; |
| 33 | |
import com.thoughtworks.xstream.mapper.AttributeMapper; |
| 34 | |
import com.thoughtworks.xstream.mapper.Mapper; |
| 35 | |
|
| 36 | |
import org.apache.shindig.social.core.model.EnumImpl; |
| 37 | |
import org.apache.shindig.social.core.util.atom.AtomAttribute; |
| 38 | |
import org.apache.shindig.social.core.util.atom.AtomAttributeConverter; |
| 39 | |
import org.apache.shindig.social.core.util.atom.AtomContent; |
| 40 | |
import org.apache.shindig.social.core.util.atom.AtomEntry; |
| 41 | |
import org.apache.shindig.social.core.util.atom.AtomFeed; |
| 42 | |
import org.apache.shindig.social.core.util.atom.AtomKeyValue; |
| 43 | |
import org.apache.shindig.social.core.util.atom.AtomLinkConverter; |
| 44 | |
import org.apache.shindig.social.opensocial.model.Account; |
| 45 | |
import org.apache.shindig.social.opensocial.model.Activity; |
| 46 | |
import org.apache.shindig.social.opensocial.model.Address; |
| 47 | |
import org.apache.shindig.social.opensocial.model.BodyType; |
| 48 | |
import org.apache.shindig.social.opensocial.model.ListField; |
| 49 | |
import org.apache.shindig.social.opensocial.model.MediaItem; |
| 50 | |
import org.apache.shindig.social.opensocial.model.Message; |
| 51 | |
import org.apache.shindig.social.opensocial.model.Name; |
| 52 | |
import org.apache.shindig.social.opensocial.model.Organization; |
| 53 | |
import org.apache.shindig.social.opensocial.model.Person; |
| 54 | |
import org.apache.shindig.social.opensocial.model.Url; |
| 55 | |
import org.apache.shindig.social.opensocial.spi.DataCollection; |
| 56 | |
import org.apache.shindig.social.opensocial.spi.RestfulCollection; |
| 57 | |
|
| 58 | |
import java.util.ArrayList; |
| 59 | |
import java.util.HashMap; |
| 60 | |
import java.util.List; |
| 61 | |
import java.util.Map; |
| 62 | |
import java.util.concurrent.ConcurrentHashMap; |
| 63 | |
|
| 64 | |
|
| 65 | |
|
| 66 | |
|
| 67 | |
public class XStream081Configuration implements XStreamConfiguration { |
| 68 | |
|
| 69 | |
|
| 70 | |
|
| 71 | |
|
| 72 | |
|
| 73 | 1 | private static final Map<ConverterSet, List<ClassFieldMapping>> listElementMappingList = Maps.newHashMap(); |
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | 1 | private static final Map<ConverterSet, List<ClassFieldMapping>> elementMappingList = Maps.newHashMap(); |
| 78 | |
|
| 79 | |
|
| 80 | |
|
| 81 | |
|
| 82 | 1 | private static final Map<ConverterSet, Map<String, Class<?>[]>> omitMap = Maps.newHashMap(); |
| 83 | |
|
| 84 | |
|
| 85 | |
|
| 86 | 1 | private static final Map<ConverterSet, Map<String, Class<?>>> elementClassMap = Maps.newHashMap(); |
| 87 | 1 | private static final Map<ConverterSet, List<ImplicitCollectionFieldMapping>> itemFieldMappings = Maps.newHashMap(); |
| 88 | 1 | private static final Map<ConverterSet, List<InterfaceFieldAliasMapping>> fieldAliasMappingList = Maps.newHashMap(); |
| 89 | 1 | private static final Map<String, NamespaceSet> namepaces = Maps.newHashMap(); |
| 90 | |
private static final String ATOM_NS = "http://www.w3.org/2005/Atom"; |
| 91 | |
private static final String OS_NS = "http://ns.opensocial.org/2008/opensocial"; |
| 92 | |
private static final String OSEARCH_NS = "http://a9.com/-/spec/opensearch/1.1"; |
| 93 | |
|
| 94 | |
static { |
| 95 | |
|
| 96 | |
|
| 97 | |
|
| 98 | |
|
| 99 | 1 | NamespaceSet atom = new NamespaceSet(); |
| 100 | 1 | atom.addNamespace("xmlns", ATOM_NS); |
| 101 | 1 | atom.addNamespace("xmlns:osearch",OSEARCH_NS); |
| 102 | 1 | atom.addPrefixedElement("totalResults","osearch:totalResults"); |
| 103 | 1 | atom.addPrefixedElement("startIndex","osearch:startIndex"); |
| 104 | 1 | atom.addPrefixedElement("itemsPerPage","osearch:itemsPerPage"); |
| 105 | 1 | namepaces.put("feed", atom); |
| 106 | 1 | NamespaceSet os = new NamespaceSet(); |
| 107 | 1 | atom.addNamespace("xmlns", OS_NS); |
| 108 | 1 | namepaces.put("person", os); |
| 109 | 1 | namepaces.put("activity", os); |
| 110 | 1 | namepaces.put("account", os); |
| 111 | 1 | namepaces.put("address", os); |
| 112 | 1 | namepaces.put("bodyType", os); |
| 113 | 1 | namepaces.put("message", os); |
| 114 | 1 | namepaces.put("mediaItem", os); |
| 115 | 1 | namepaces.put("name", os); |
| 116 | 1 | namepaces.put("url", os); |
| 117 | 1 | namepaces.put("reponse", os); |
| 118 | 1 | namepaces.put("appdata", os); |
| 119 | |
|
| 120 | 1 | List<ClassFieldMapping> defaultElementMappingList = Lists.newArrayList(); |
| 121 | |
|
| 122 | 1 | defaultElementMappingList.add(new ClassFieldMapping("feed", |
| 123 | |
AtomFeed.class)); |
| 124 | 1 | defaultElementMappingList.add(new ClassFieldMapping("content", |
| 125 | |
AtomContent.class)); |
| 126 | |
|
| 127 | 1 | defaultElementMappingList.add(new ClassFieldMapping("activity", |
| 128 | |
Activity.class)); |
| 129 | 1 | defaultElementMappingList.add(new ClassFieldMapping("account", |
| 130 | |
Account.class)); |
| 131 | 1 | defaultElementMappingList.add(new ClassFieldMapping("address", |
| 132 | |
Address.class)); |
| 133 | 1 | defaultElementMappingList.add(new ClassFieldMapping("bodyType", |
| 134 | |
BodyType.class)); |
| 135 | 1 | defaultElementMappingList.add(new ClassFieldMapping("message", |
| 136 | |
Message.class)); |
| 137 | 1 | defaultElementMappingList.add(new ClassFieldMapping("mediaItem", |
| 138 | |
MediaItem.class)); |
| 139 | 1 | defaultElementMappingList.add(new ClassFieldMapping("name", Name.class)); |
| 140 | 1 | defaultElementMappingList.add(new ClassFieldMapping("organization", |
| 141 | |
Organization.class)); |
| 142 | 1 | defaultElementMappingList |
| 143 | |
.add(new ClassFieldMapping("person", Person.class)); |
| 144 | 1 | defaultElementMappingList.add(new ClassFieldMapping("url", Url.class)); |
| 145 | |
|
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | 1 | defaultElementMappingList.add(new ClassFieldMapping("ListField", |
| 151 | |
ListField.class)); |
| 152 | |
|
| 153 | |
|
| 154 | |
|
| 155 | |
|
| 156 | |
|
| 157 | 1 | defaultElementMappingList.add(new ClassFieldMapping("response", |
| 158 | |
RestfulCollection.class)); |
| 159 | 1 | defaultElementMappingList.add(new ClassFieldMapping("appdata", |
| 160 | |
DataCollection.class)); |
| 161 | 1 | defaultElementMappingList.add(new ClassFieldMapping("list", List.class)); |
| 162 | 1 | defaultElementMappingList.add(new ClassFieldMapping("map", Map.class)); |
| 163 | |
|
| 164 | 1 | elementMappingList.put(ConverterSet.DEFAULT, defaultElementMappingList); |
| 165 | |
|
| 166 | |
|
| 167 | |
|
| 168 | 1 | List<ClassFieldMapping> collectionElementMappingList = Lists.newArrayList(); |
| 169 | |
|
| 170 | 1 | collectionElementMappingList.add(new ClassFieldMapping("feed", |
| 171 | |
AtomFeed.class)); |
| 172 | 1 | collectionElementMappingList.add(new ClassFieldMapping("content", |
| 173 | |
AtomContent.class)); |
| 174 | |
|
| 175 | 1 | collectionElementMappingList.add(new ClassFieldMapping("activity", |
| 176 | |
Activity.class)); |
| 177 | 1 | collectionElementMappingList.add(new ClassFieldMapping("account", |
| 178 | |
Account.class)); |
| 179 | 1 | collectionElementMappingList.add(new ClassFieldMapping("address", |
| 180 | |
Address.class)); |
| 181 | 1 | collectionElementMappingList.add(new ClassFieldMapping("bodyType", |
| 182 | |
BodyType.class)); |
| 183 | 1 | collectionElementMappingList.add(new ClassFieldMapping("message", |
| 184 | |
Message.class)); |
| 185 | 1 | collectionElementMappingList.add(new ClassFieldMapping("mediaItem", |
| 186 | |
MediaItem.class)); |
| 187 | 1 | collectionElementMappingList.add(new ClassFieldMapping("name", Name.class)); |
| 188 | 1 | collectionElementMappingList.add(new ClassFieldMapping("organization", |
| 189 | |
Organization.class)); |
| 190 | 1 | collectionElementMappingList.add(new ClassFieldMapping("person", |
| 191 | |
Person.class)); |
| 192 | 1 | collectionElementMappingList.add(new ClassFieldMapping("url", Url.class)); |
| 193 | |
|
| 194 | |
|
| 195 | |
|
| 196 | |
|
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
|
| 202 | 1 | collectionElementMappingList.add(new ClassFieldMapping("ListField", |
| 203 | |
ListField.class)); |
| 204 | |
|
| 205 | |
|
| 206 | |
|
| 207 | |
|
| 208 | |
|
| 209 | 1 | collectionElementMappingList.add(new ClassFieldMapping("response", |
| 210 | |
RestfulCollection.class)); |
| 211 | 1 | collectionElementMappingList.add(new ClassFieldMapping("list", List.class)); |
| 212 | 1 | collectionElementMappingList.add(new ClassFieldMapping("map", Map.class)); |
| 213 | |
|
| 214 | 1 | elementMappingList.put(ConverterSet.COLLECTION, |
| 215 | |
collectionElementMappingList); |
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | |
|
| 221 | 1 | Map<String, Class<?>[]> defaultOmitMap = Maps.newHashMap(); |
| 222 | 1 | defaultOmitMap.put("isOwner", new Class[] { Person.class }); |
| 223 | 1 | defaultOmitMap.put("isViewer", new Class[] { Person.class }); |
| 224 | 1 | omitMap.put(ConverterSet.DEFAULT, defaultOmitMap); |
| 225 | |
|
| 226 | 1 | Map<String, Class<?>> defaultElementClassMap = Maps.newHashMap(); |
| 227 | 1 | defaultElementClassMap.put("feed", AtomFeed.class); |
| 228 | 1 | defaultElementClassMap.put("content", AtomContent.class); |
| 229 | 1 | defaultElementClassMap.put("person", Person.class); |
| 230 | 1 | defaultElementClassMap.put("email", ListField.class); |
| 231 | 1 | defaultElementClassMap.put("phone", ListField.class); |
| 232 | 1 | defaultElementClassMap.put("list", ArrayList.class); |
| 233 | 1 | defaultElementClassMap.put("map", ConcurrentHashMap.class); |
| 234 | 1 | defaultElementClassMap.put("appdata", DataCollection.class); |
| 235 | 1 | defaultElementClassMap.put("activity", Activity.class); |
| 236 | 1 | defaultElementClassMap.put("account", Account.class); |
| 237 | 1 | defaultElementClassMap.put("address", Address.class); |
| 238 | 1 | defaultElementClassMap.put("bodyType", BodyType.class); |
| 239 | 1 | defaultElementClassMap.put("message", Message.class); |
| 240 | 1 | defaultElementClassMap.put("mediaItem", MediaItem.class); |
| 241 | 1 | defaultElementClassMap.put("name", Name.class); |
| 242 | 1 | defaultElementClassMap.put("organization", Organization.class); |
| 243 | 1 | defaultElementClassMap.put("person", Person.class); |
| 244 | 1 | defaultElementClassMap.put("url", Url.class); |
| 245 | 1 | defaultElementClassMap.put("listField", ListField.class); |
| 246 | 1 | elementClassMap.put(ConverterSet.DEFAULT, defaultElementClassMap); |
| 247 | |
|
| 248 | 1 | List<ImplicitCollectionFieldMapping> defaultItemFieldMappings = Lists.newArrayList(); |
| 249 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 250 | |
AtomFeed.class, "entry", AtomEntry.class, "entry")); |
| 251 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 252 | |
AtomContent.class, "entry", AtomKeyValue.class, "entry")); |
| 253 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 254 | |
Person.class, "books", String.class, "books")); |
| 255 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 256 | |
Person.class, "cars", String.class, "cars")); |
| 257 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 258 | |
Person.class, "heroes", String.class, "heroes")); |
| 259 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 260 | |
Person.class, "food", String.class, "food")); |
| 261 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 262 | |
Person.class, "interests", String.class, "interests")); |
| 263 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 264 | |
Person.class, "languagesSpoken", String.class, "languagesSpoken")); |
| 265 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 266 | |
Person.class, "movies", String.class, "movies")); |
| 267 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 268 | |
Person.class, "music", String.class, "music")); |
| 269 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 270 | |
Person.class, "quotes", String.class, "quotes")); |
| 271 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 272 | |
Person.class, "sports", String.class, "sports")); |
| 273 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 274 | |
Person.class, "tags", String.class, "tags")); |
| 275 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 276 | |
Person.class, "turnOns", String.class, "turnOns")); |
| 277 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 278 | |
Person.class, "turnOffs", String.class, "turnOffs")); |
| 279 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 280 | |
Person.class, "tvShows", String.class, "tvShows")); |
| 281 | |
|
| 282 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 283 | |
Person.class, "emails", ListField.class, "emails")); |
| 284 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 285 | |
Person.class, "phoneNumbers", ListField.class, "phoneNumbers")); |
| 286 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 287 | |
Person.class, "ims", ListField.class, "ims")); |
| 288 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 289 | |
Person.class, "photos", ListField.class, "photos")); |
| 290 | |
|
| 291 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 292 | |
Person.class, "activities", Activity.class, "activities")); |
| 293 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 294 | |
Person.class, "addresses", Address.class, "addresses")); |
| 295 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 296 | |
Person.class, "organizations", Organization.class, "organizations")); |
| 297 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 298 | |
Person.class, "urls", Url.class, "urls")); |
| 299 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 300 | |
Person.class, "lookingFor", EnumImpl.class, "lookingFor")); |
| 301 | |
|
| 302 | 1 | defaultItemFieldMappings.add(new ImplicitCollectionFieldMapping( |
| 303 | |
Activity.class, "mediaItems", MediaItem.class, "mediaItems")); |
| 304 | |
|
| 305 | 1 | itemFieldMappings.put(ConverterSet.DEFAULT, defaultItemFieldMappings); |
| 306 | |
|
| 307 | 1 | List<ClassFieldMapping> defaultListElementMappingList = Lists.newArrayList(); |
| 308 | 1 | listElementMappingList.put(ConverterSet.DEFAULT, |
| 309 | |
defaultListElementMappingList); |
| 310 | |
|
| 311 | 1 | List<InterfaceFieldAliasMapping> defaultFieldAliasMappingList = Lists.newArrayList(); |
| 312 | |
|
| 313 | |
|
| 314 | |
|
| 315 | |
|
| 316 | |
|
| 317 | |
|
| 318 | |
|
| 319 | |
|
| 320 | |
|
| 321 | |
|
| 322 | 1 | fieldAliasMappingList.put(ConverterSet.DEFAULT, |
| 323 | |
defaultFieldAliasMappingList); |
| 324 | 1 | } |
| 325 | |
|
| 326 | |
|
| 327 | |
|
| 328 | |
|
| 329 | |
private Injector injector; |
| 330 | |
|
| 331 | |
|
| 332 | |
|
| 333 | |
|
| 334 | |
@Inject |
| 335 | 74 | public XStream081Configuration(Injector injector) { |
| 336 | 74 | this.injector = injector; |
| 337 | 74 | } |
| 338 | |
|
| 339 | |
private Map<String, Class<?>> getElementClassMap(ConverterSet c) { |
| 340 | 222 | Map<String, Class<?>> ecm = elementClassMap.get(c); |
| 341 | 222 | if (ecm == null) { |
| 342 | 148 | ecm = elementClassMap.get(ConverterSet.DEFAULT); |
| 343 | |
} |
| 344 | 222 | return ecm; |
| 345 | |
} |
| 346 | |
|
| 347 | |
private List<ClassFieldMapping> getElementMappingList(ConverterSet c) { |
| 348 | 222 | List<ClassFieldMapping> eml = elementMappingList.get(c); |
| 349 | 222 | if (eml == null) { |
| 350 | 74 | eml = elementMappingList.get(ConverterSet.DEFAULT); |
| 351 | |
} |
| 352 | 222 | return eml; |
| 353 | |
} |
| 354 | |
|
| 355 | |
private List<ClassFieldMapping> getListElementMappingList(ConverterSet c) { |
| 356 | 222 | List<ClassFieldMapping> leml = listElementMappingList.get(c); |
| 357 | 222 | if (leml == null) { |
| 358 | 148 | leml = listElementMappingList.get(ConverterSet.DEFAULT); |
| 359 | |
} |
| 360 | 222 | return leml; |
| 361 | |
} |
| 362 | |
|
| 363 | |
private Map<String, Class<?>[]> getOmitMap(ConverterSet c) { |
| 364 | 222 | Map<String, Class<?>[]> om = omitMap.get(c); |
| 365 | 222 | if (om == null) { |
| 366 | 148 | om = omitMap.get(ConverterSet.DEFAULT); |
| 367 | |
} |
| 368 | 222 | return om; |
| 369 | |
} |
| 370 | |
|
| 371 | |
private Converter[] getConverters(Mapper mapper, ConverterSet c) { |
| 372 | 222 | return new Converter[] { new MapConverter(mapper), |
| 373 | |
new RestfullCollectionConverter(mapper), |
| 374 | |
new DataCollectionConverter(mapper), |
| 375 | |
new AtomLinkConverter()}; |
| 376 | |
} |
| 377 | |
|
| 378 | |
|
| 379 | |
|
| 380 | |
|
| 381 | |
|
| 382 | |
private List<ImplicitCollectionFieldMapping> getItemFieldMappings( |
| 383 | |
ConverterSet c) { |
| 384 | 222 | List<ImplicitCollectionFieldMapping> om = itemFieldMappings.get(c); |
| 385 | 222 | if (om == null) { |
| 386 | 148 | om = itemFieldMappings.get(ConverterSet.DEFAULT); |
| 387 | |
} |
| 388 | 222 | return om; |
| 389 | |
} |
| 390 | |
|
| 391 | |
|
| 392 | |
|
| 393 | |
|
| 394 | |
|
| 395 | |
private List<InterfaceFieldAliasMapping> getFieldAliasMappingList( |
| 396 | |
ConverterSet c) { |
| 397 | 222 | List<InterfaceFieldAliasMapping> om = fieldAliasMappingList.get(c); |
| 398 | 222 | if (om == null) { |
| 399 | 148 | om = fieldAliasMappingList.get(ConverterSet.DEFAULT); |
| 400 | |
} |
| 401 | 222 | return om; |
| 402 | |
} |
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
|
| 407 | |
|
| 408 | |
|
| 409 | |
|
| 410 | |
|
| 411 | |
|
| 412 | |
|
| 413 | |
|
| 414 | |
public ConverterConfig getConverterConfig(ConverterSet c, ReflectionProvider rp, |
| 415 | |
Mapper dmapper, HierarchicalStreamDriver driver, WriterStack writerStack) { |
| 416 | |
|
| 417 | 222 | InterfaceFieldAliasingMapper emapper = new InterfaceFieldAliasingMapper( |
| 418 | |
dmapper, writerStack, getFieldAliasMappingList(c)); |
| 419 | 222 | InterfaceClassMapper fmapper = new InterfaceClassMapper(writerStack, emapper, |
| 420 | |
getElementMappingList(c), getListElementMappingList(c), |
| 421 | |
getItemFieldMappings(c), getOmitMap(c), getElementClassMap(c)); |
| 422 | 222 | AttributeMapper amapper = new AttributeMapper(fmapper); |
| 423 | |
|
| 424 | 222 | XStream xstream = new XStream(rp, amapper, driver); |
| 425 | 222 | amapper.addAttributeFor(AtomAttribute.class); |
| 426 | 1110 | for (Converter converter : getConverters(fmapper, c)) { |
| 427 | 888 | xstream.registerConverter(converter); |
| 428 | |
} |
| 429 | 222 | xstream.registerConverter(new ISO8601DateConverter()); |
| 430 | 222 | xstream.registerConverter(new ISO8601GregorianCalendarConverter()); |
| 431 | 222 | xstream.registerConverter(new ISO8601SqlTimestampConverter()); |
| 432 | 222 | xstream.registerConverter(new GuiceBeanConverter(fmapper, injector)); |
| 433 | 222 | xstream.registerConverter(new AtomAttributeConverter()); |
| 434 | 222 | xstream.setMode(XStream.NO_REFERENCES); |
| 435 | |
|
| 436 | 222 | return new ConverterConfig(fmapper,xstream); |
| 437 | |
|
| 438 | |
} |
| 439 | |
|
| 440 | |
|
| 441 | |
|
| 442 | |
|
| 443 | |
|
| 444 | |
|
| 445 | |
public Map<String, NamespaceSet> getNameSpaces() { |
| 446 | 74 | return namepaces; |
| 447 | |
} |
| 448 | |
} |