| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| SearchResultColumnWriter |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2009 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.osedu.org/licenses/ECL-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.student.contract.writer.search; | |
| 17 | ||
| 18 | import org.kuali.student.contract.model.SearchResultColumn; | |
| 19 | import org.kuali.student.contract.writer.XmlWriter; | |
| 20 | ||
| 21 | import java.io.PrintStream; | |
| 22 | ||
| 23 | /** | |
| 24 | * Writes out a constraint in XML format. | |
| 25 | * @author nwright | |
| 26 | */ | |
| 27 | public class SearchResultColumnWriter extends XmlWriter { | |
| 28 | ||
| 29 | private SearchResultColumn column; | |
| 30 | ||
| 31 | public SearchResultColumnWriter(PrintStream out, int indent, | |
| 32 | SearchResultColumn column) { | |
| 33 | 0 | super(out, indent); |
| 34 | 0 | this.column = column; |
| 35 | 0 | } |
| 36 | ||
| 37 | public void write() { | |
| 38 | 0 | println(""); |
| 39 | 0 | indentPrint("<search:resultColumn"); |
| 40 | //TODO: not sure what to put in the key attribute | |
| 41 | 0 | incrementIndent(); |
| 42 | 0 | writeAttribute("id", column.getKey()); |
| 43 | 0 | println(">"); |
| 44 | ||
| 45 | // write out comments | |
| 46 | 0 | writeComment(column.getComments()); |
| 47 | ||
| 48 | 0 | writeTag("search:name", column.getName()); |
| 49 | 0 | writeTag("search:desc", column.getDescription()); |
| 50 | 0 | writeTag("search:dataType", column.getDataType()); |
| 51 | ||
| 52 | 0 | indentPrintln("</search:resultColumn>"); |
| 53 | 0 | decrementIndent(); |
| 54 | 0 | } |
| 55 | } |