1 package org.kuali.ole.ingest;
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.ingest.pojo.ProfileAttributeBo;
9
10
11
12
13 public class ProfileAttributeConverter implements Converter {
14 @Override
15 public void marshal(Object o, HierarchicalStreamWriter hierarchicalStreamWriter, MarshallingContext marshallingContext) {
16
17 }
18
19
20
21
22
23
24
25 @Override
26 public Object unmarshal(HierarchicalStreamReader hierarchicalStreamReader, UnmarshallingContext unmarshallingContext) {
27 ProfileAttributeBo profileAttributeBo = new ProfileAttributeBo();
28 profileAttributeBo.setAttributeName(hierarchicalStreamReader.getAttribute("name"));
29 profileAttributeBo.setSystemValue(hierarchicalStreamReader.getAttribute("system"));
30 profileAttributeBo.setAttributeValue(hierarchicalStreamReader.getValue());
31 return profileAttributeBo;
32 }
33
34
35
36
37
38
39
40 @Override
41 public boolean canConvert(Class aClass) {
42 return aClass.equals(ProfileAttributeBo.class);
43 }
44 }