1 package com.thoughtworks.xstream.core; 2 3 import com.thoughtworks.xstream.MarshallingStrategy; 4 import com.thoughtworks.xstream.alias.ClassMapper; 5 import com.thoughtworks.xstream.io.HierarchicalStreamReader; 6 import com.thoughtworks.xstream.io.HierarchicalStreamWriter; 7 8 public class ReferenceByIdMarshallingStrategy implements MarshallingStrategy { 9 10 public Object unmarshal(Object root, HierarchicalStreamReader reader, DefaultConverterLookup converterLookup, ClassMapper classMapper) { 11 return new ReferenceByIdUnmarshaller( 12 root, reader, converterLookup, 13 classMapper, converterLookup.getClassAttributeIdentifier()).start(); 14 } 15 16 public void marshal(HierarchicalStreamWriter writer, Object obj, DefaultConverterLookup converterLookup, ClassMapper classMapper) { 17 new ReferenceByIdMarshaller( 18 writer, converterLookup, classMapper).start(obj); 19 } 20 21 } 22 | Popular Tags |