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.OleSRUExplainIndexSet;
9
10
11
12
13
14
15
16
17 public class OleSRUExplainIndexInfoConverter implements Converter {
18
19
20
21
22 @Override
23 public void marshal(Object o, HierarchicalStreamWriter hierarchicalStreamWriter,
24 MarshallingContext marshallingContext) {
25 OleSRUExplainIndexSet oleSRUExplainIndexSet = (OleSRUExplainIndexSet) o;
26 hierarchicalStreamWriter.addAttribute("name", oleSRUExplainIndexSet.getName());
27 hierarchicalStreamWriter.addAttribute("identifier", oleSRUExplainIndexSet.getIdentifier());
28 hierarchicalStreamWriter.setValue(oleSRUExplainIndexSet.getValue());
29 }
30
31 @Override
32 public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader,
33 UnmarshallingContext unmarshallingContext) {
34 OleSRUExplainIndexSet oleSRUExplainIndexSet = new OleSRUExplainIndexSet();
35 oleSRUExplainIndexSet.setName(hierarchicalStreamReader.getAttribute("name"));
36 oleSRUExplainIndexSet.setIdentifier(hierarchicalStreamReader.getAttribute("identifier"));
37 oleSRUExplainIndexSet.setValue(hierarchicalStreamReader.getValue());
38 return oleSRUExplainIndexSet;
39 }
40
41 @Override
42 public boolean canConvert(Class aClass) {
43 return aClass.equals(OleSRUExplainIndexSet.class);
44 }
45 }