1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.student.r2.core.search.dto; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.ArrayList; |
21 | |
import java.util.List; |
22 | |
|
23 | |
import javax.xml.bind.annotation.XmlAccessType; |
24 | |
import javax.xml.bind.annotation.XmlAccessorType; |
25 | |
import javax.xml.bind.annotation.XmlAnyElement; |
26 | |
import javax.xml.bind.annotation.XmlElement; |
27 | |
import javax.xml.bind.annotation.XmlType; |
28 | |
|
29 | |
import org.kuali.student.r2.core.search.infc.SearchResultRow; |
30 | |
import org.kuali.student.r2.core.search.infc.SearchResultCell; |
31 | |
import org.w3c.dom.Element; |
32 | |
|
33 | |
@XmlAccessorType(XmlAccessType.FIELD) |
34 | |
@XmlType(name = "SearchResultRowInfo", propOrder = { |
35 | |
"cells", "_futureElements" }) |
36 | |
|
37 | |
public class SearchResultRowInfo |
38 | |
implements SearchResultRow, Serializable { |
39 | |
|
40 | |
private static final long serialVersionUID = 1L; |
41 | |
|
42 | |
@XmlElement |
43 | |
private List<SearchResultCellInfo> cells; |
44 | |
|
45 | |
@XmlAnyElement |
46 | |
private List<Element> _futureElements; |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | 0 | public SearchResultRowInfo() { |
53 | 0 | } |
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | 0 | public SearchResultRowInfo(SearchResultRow row) { |
62 | 0 | if (row != null) { |
63 | 0 | this.cells = new ArrayList<SearchResultCellInfo>(); |
64 | 0 | for (SearchResultCell cell : row.getCells()) { |
65 | 0 | this.cells.add(new SearchResultCellInfo(cell)); |
66 | |
} |
67 | |
} |
68 | 0 | } |
69 | |
|
70 | |
public void addCell(String key, String value) { |
71 | 0 | getCells().add(new SearchResultCellInfo(key, value)); |
72 | 0 | } |
73 | |
|
74 | |
@Override |
75 | |
public List<SearchResultCellInfo> getCells() { |
76 | 0 | if (cells == null) { |
77 | 0 | cells = new ArrayList<SearchResultCellInfo>(0); |
78 | |
} |
79 | 0 | return cells; |
80 | |
} |
81 | |
|
82 | |
public void setCells(List<SearchResultCellInfo> cells) { |
83 | 0 | this.cells = cells; |
84 | 0 | } |
85 | |
|
86 | |
@Override |
87 | |
public String toString() { |
88 | 0 | return "SearchResultRow[cells=" + cells + "]"; |
89 | |
} |
90 | |
} |