1 package org.kuali.ole.converters;
2
3 import com.thoughtworks.xstream.converters.Converter;
4 import com.thoughtworks.xstream.converters.MarshallingContext;
5 import com.thoughtworks.xstream.converters.UnmarshallingContext;
6 import com.thoughtworks.xstream.io.HierarchicalStreamReader;
7 import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
8 import org.kuali.ole.bo.explain.OleSRUExplainIndexMapName;
9
10
11
12
13
14
15
16
17 public class OleSRUExplainIndexMapNameConverter implements Converter {
18
19 @Override
20 public void marshal(Object o, HierarchicalStreamWriter hierarchicalStreamWriter,
21 MarshallingContext marshallingContext) {
22 OleSRUExplainIndexMapName oleSRUExplainIndexMapName = (OleSRUExplainIndexMapName) o;
23 hierarchicalStreamWriter.addAttribute("set", oleSRUExplainIndexMapName.getSet());
24 hierarchicalStreamWriter.setValue(oleSRUExplainIndexMapName.getValue());
25 }
26
27 @Override
28 public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader,
29 UnmarshallingContext unmarshallingContext) {
30 OleSRUExplainIndexMapName oleSRUExplainIndexMapName = new OleSRUExplainIndexMapName();
31 oleSRUExplainIndexMapName.setSet(hierarchicalStreamReader.getAttribute("set"));
32 oleSRUExplainIndexMapName.setValue(hierarchicalStreamReader.getValue());
33 return oleSRUExplainIndexMapName;
34 }
35
36 @Override
37 public boolean canConvert(Class aClass) {
38 return aClass.equals(OleSRUExplainIndexMapName.class);
39 }
40 }