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