1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.datadictionary.parse;
17
18 import org.kuali.rice.krad.util.KRADUtils;
19 import org.springframework.core.convert.TypeDescriptor;
20 import org.springframework.core.convert.converter.GenericConverter;
21
22 import java.util.HashSet;
23 import java.util.List;
24 import java.util.Set;
25
26
27
28
29
30
31
32 public class StringListConverter implements GenericConverter {
33
34 @Override
35 public Set<ConvertiblePair> getConvertibleTypes() {
36 Set<ConvertiblePair> pairs = new HashSet<ConvertiblePair>();
37
38 ConvertiblePair stringListPair = new ConvertiblePair(String.class, List.class);
39 pairs.add(stringListPair);
40
41 return pairs;
42 }
43
44 @Override
45 public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
46 return KRADUtils.convertStringParameterToList((String) source);
47 }
48 }