1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.r2.core.statement.dto; |
17 | |
|
18 | |
import org.kuali.student.r2.common.dto.IdEntityInfo; |
19 | |
import org.kuali.student.r2.core.statement.infc.ReqComponent; |
20 | |
import org.kuali.student.r2.core.statement.infc.StatementTreeView; |
21 | |
import org.w3c.dom.Element; |
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 | |
import java.util.ArrayList; |
29 | |
import java.util.List; |
30 | |
|
31 | |
@XmlAccessorType(XmlAccessType.FIELD) |
32 | |
@XmlType(name = "StatementTreeViewInfo", propOrder = {"id", "typeKey", "stateKey", |
33 | |
"name", "descr", "operator", "statements", "reqComponents", "meta", "attributes", "_futureElements"}) |
34 | |
public class StatementTreeViewInfo extends IdEntityInfo implements StatementTreeView { |
35 | |
|
36 | |
private static final long serialVersionUID = 1L; |
37 | |
|
38 | |
@XmlElement |
39 | |
private StatementOperator operator; |
40 | |
@XmlElement |
41 | |
private List<StatementTreeViewInfo> statements; |
42 | |
@XmlElement |
43 | |
private List<ReqComponentInfo> reqComponents; |
44 | |
@XmlAnyElement |
45 | |
private List<Element> _futureElements; |
46 | |
|
47 | 0 | public StatementTreeViewInfo() { |
48 | 0 | } |
49 | |
|
50 | |
public StatementTreeViewInfo(StatementTreeView statementTreeView) { |
51 | 0 | super(statementTreeView); |
52 | 0 | if (null != statementTreeView) { |
53 | 0 | this.operator = statementTreeView.getOperator(); |
54 | 0 | this.statements = new ArrayList<StatementTreeViewInfo>(); |
55 | 0 | for (StatementTreeView statementTreeViewTemp : statementTreeView.getStatements()) { |
56 | |
|
57 | 0 | this.statements.add(new StatementTreeViewInfo(statementTreeViewTemp)); |
58 | |
} |
59 | 0 | this.reqComponents = new ArrayList<ReqComponentInfo>(); |
60 | 0 | for (ReqComponent reqComponentInfo : statementTreeView.getReqComponents()) { |
61 | 0 | this.reqComponents.add(new ReqComponentInfo(reqComponentInfo)); |
62 | |
} |
63 | |
} |
64 | 0 | } |
65 | |
|
66 | |
@Override |
67 | |
public StatementOperator getOperator() { |
68 | 0 | return this.operator; |
69 | |
} |
70 | |
|
71 | |
public void setOperator(StatementOperator operator) { |
72 | 0 | this.operator = operator; |
73 | 0 | } |
74 | |
|
75 | |
@Override |
76 | |
public List<StatementTreeViewInfo> getStatements() { |
77 | 0 | if (this.statements == null) { |
78 | 0 | this.statements = new ArrayList<StatementTreeViewInfo>(0); |
79 | |
} |
80 | 0 | return this.statements; |
81 | |
} |
82 | |
|
83 | |
public void setStatements(List<StatementTreeViewInfo> statements) { |
84 | 0 | this.statements = statements; |
85 | 0 | } |
86 | |
|
87 | |
@Override |
88 | |
public List<ReqComponentInfo> getReqComponents() { |
89 | 0 | if (this.reqComponents == null) { |
90 | 0 | this.reqComponents = new ArrayList<ReqComponentInfo>(0); |
91 | |
} |
92 | 0 | return this.reqComponents; |
93 | |
} |
94 | |
|
95 | |
public void setReqComponents(List<ReqComponentInfo> reqComponents) { |
96 | 0 | this.reqComponents = reqComponents; |
97 | 0 | } |
98 | |
|
99 | |
@Override |
100 | |
public String toString() { |
101 | 0 | return "StatementTreeViewInfo[id=" + getId() + "]"; |
102 | |
} |
103 | |
} |