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 ReferenceByXPathMarshallingStrategy implements MarshallingStrategy { 9 10 public Object unmarshal(Object root, HierarchicalStreamReader reader, DefaultConverterLookup converterLookup, ClassMapper classMapper) { 11 return new ReferenceByXPathUnmarshaller(root, reader, converterLookup, 12 classMapper, converterLookup.getClassAttributeIdentifier()).start(); 13 } 14 15 public void marshal(HierarchicalStreamWriter writer, Object obj, DefaultConverterLookup converterLookup, ClassMapper classMapper) { 16 new ReferenceByXPathMarshaller(writer, converterLookup, classMapper).start(obj); 17 } 18 } 19 | Popular Tags |