1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.contract.writer.search; |
17 |
|
|
18 |
|
import org.kuali.student.contract.model.SearchCriteria; |
19 |
|
import org.kuali.student.contract.model.SearchCriteriaParameter; |
20 |
|
import org.kuali.student.contract.writer.XmlWriter; |
21 |
|
|
22 |
|
import java.io.PrintStream; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
@author |
27 |
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 3 |
Complexity Density: 0.16 |
|
28 |
|
public class SearchCriteriaWriter extends XmlWriter |
29 |
|
{ |
30 |
|
|
31 |
|
private SearchCriteria searchCriteria; |
32 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
33 |
0
|
public SearchCriteriaWriter (PrintStream out, int indent,... |
34 |
|
SearchCriteria searchCriteria) |
35 |
|
{ |
36 |
0
|
super (out, indent); |
37 |
0
|
this.searchCriteria = searchCriteria; |
38 |
|
} |
39 |
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
|
40 |
0
|
public void write ()... |
41 |
|
{ |
42 |
|
|
43 |
0
|
println (""); |
44 |
0
|
indentPrint ("<search:searchCriteriaTypeInfo"); |
45 |
|
|
46 |
0
|
writeAttribute ("id", searchCriteria.getKey ()); |
47 |
0
|
println (">"); |
48 |
0
|
incrementIndent (); |
49 |
|
|
50 |
|
|
51 |
0
|
writeComment (searchCriteria.getComments ()); |
52 |
|
|
53 |
0
|
writeTag ("search:name", searchCriteria.getName ()); |
54 |
0
|
writeTag ("search:desc", searchCriteria.getDescription ()); |
55 |
0
|
indentPrintln ("<search:queryParams>"); |
56 |
0
|
incrementIndent (); |
57 |
0
|
for (SearchCriteriaParameter col : searchCriteria.getParameters ()) |
58 |
|
{ |
59 |
0
|
indentPrintln (calcRefBean (col.getKey ())); |
60 |
|
} |
61 |
0
|
decrementIndent (); |
62 |
0
|
indentPrintln ("</search:queryParams>"); |
63 |
|
|
64 |
0
|
indentPrintln ("</search:searchCriteriaTypeInfo>"); |
65 |
0
|
decrementIndent (); |
66 |
|
} |
67 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
68 |
0
|
private String calcRefBean (String id)... |
69 |
|
{ |
70 |
0
|
return "<ref bean=\"" + id + "\" />"; |
71 |
|
} |
72 |
|
|
73 |
|
} |