| 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.SearchResult; |
| 19 |
|
import org.kuali.student.contract.model.SearchResultColumn; |
| 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 SearchResultWriter extends XmlWriter { |
| 29 |
|
|
| 30 |
|
private SearchResult searchResult; |
| 31 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 32 |
0
|
public SearchResultWriter(PrintStream out, int indent,... |
| 33 |
|
SearchResult searchResult) { |
| 34 |
0
|
super(out, indent); |
| 35 |
0
|
this.searchResult = searchResult; |
| 36 |
|
} |
| 37 |
|
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 1 |
Complexity Density: 0.06 |
|
| 38 |
0
|
public void write() {... |
| 39 |
|
|
| 40 |
0
|
println(""); |
| 41 |
0
|
indentPrint("<search:searchResultTypeInfo"); |
| 42 |
|
|
| 43 |
0
|
writeAttribute("id", searchResult.getKey()); |
| 44 |
0
|
println(">"); |
| 45 |
0
|
incrementIndent(); |
| 46 |
|
|
| 47 |
0
|
writeComment(searchResult.getComments()); |
| 48 |
|
|
| 49 |
0
|
writeTag("search:name", searchResult.getName()); |
| 50 |
0
|
writeTag("search:desc", searchResult.getDescription()); |
| 51 |
0
|
indentPrintln("<search:resultColumns>"); |
| 52 |
0
|
incrementIndent(); |
| 53 |
0
|
for (SearchResultColumn col : searchResult.getResultColumns()) { |
| 54 |
0
|
indentPrintln(calcRefBean(col.getKey())); |
| 55 |
|
} |
| 56 |
0
|
decrementIndent(); |
| 57 |
0
|
indentPrintln("</search:resultColumns>"); |
| 58 |
0
|
indentPrintln("</search:searchResultTypeInfo>"); |
| 59 |
0
|
decrementIndent(); |
| 60 |
|
} |
| 61 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 62 |
0
|
private String calcRefBean(String id) {... |
| 63 |
0
|
return "<ref bean=\"" + id + "\" />"; |
| 64 |
|
} |
| 65 |
|
} |