KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > thoughtworks > xstream > core > ReferenceByIdMarshallingStrategy


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 JavaDoc unmarshal(Object JavaDoc 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 JavaDoc obj, DefaultConverterLookup converterLookup, ClassMapper classMapper) {
17         new ReferenceByIdMarshaller(
18                 writer, converterLookup, classMapper).start(obj);
19     }
20
21 }
22
Popular Tags