Coverage Report - org.kuali.student.contract.model.util.MessageStructureDumper
 
Classes in this File Line Coverage Branch Coverage Complexity
MessageStructureDumper
0%
0/61
N/A
1
 
 1  
 /*
 2  
  * To change this template, choose Tools | Templates
 3  
  * and open the template in the editor.
 4  
  */
 5  
 package org.kuali.student.contract.model.util;
 6  
 
 7  
 import java.io.PrintStream;
 8  
 
 9  
 import org.kuali.student.contract.model.MessageStructure;
 10  
 
 11  
 /**
 12  
  *
 13  
  * @author nwright
 14  
  */
 15  
 public class MessageStructureDumper {
 16  
 
 17  
     private MessageStructure messageStructure;
 18  
     private PrintStream out;
 19  
 
 20  
     public MessageStructureDumper(MessageStructure messageStructure,
 21  0
             PrintStream out) {
 22  0
         this.messageStructure = messageStructure;
 23  0
         this.out = out;
 24  0
     }
 25  
 
 26  
     public void dump() {
 27  0
         out.println(
 28  
                 messageStructure.getXmlObject() + "." + messageStructure.getShortName()
 29  
                 + " - " + messageStructure.getName() + " - " + messageStructure.getType()
 30  
                 + " http:XXX" + messageStructure.getUrl() + " - " + messageStructure.getDescription());
 31  0
     }
 32  
 
 33  
     public void writeTabbedHeader() {
 34  0
         out.print("id");
 35  0
         out.print("\t");
 36  0
         out.print("Action");
 37  0
         out.print("\t");
 38  0
         out.print("xmlObject");
 39  0
         out.print("\t");
 40  0
         out.print("ShortName");
 41  0
         out.print("\t");
 42  0
         out.print("Name");
 43  0
         out.print("\t");
 44  0
         out.print("Type");
 45  0
         out.print("\t");
 46  0
         out.print("Description");
 47  0
         out.print("\t");
 48  0
         out.print("Required");
 49  0
         out.print("\t");
 50  0
         out.print("Cardinality");
 51  0
         out.print("\t");
 52  0
         out.print("XMLAttribute");
 53  0
         out.print("\t");
 54  0
         out.print("Status");
 55  0
         out.print("\t");
 56  0
         out.print("Feedback");
 57  0
         out.println("");
 58  0
     }
 59  
 
 60  
     private String clean(String str) {
 61  0
         str = str.replace("\n", " ");
 62  0
         str = str.replace("\t", " ");
 63  0
         str = str.replace("\r", str);
 64  0
         str = str.replace("\f", " ");
 65  0
         return str;
 66  
     }
 67  
 
 68  
     public void writeTabbedData() {
 69  0
         out.print(messageStructure.getId());
 70  0
         out.print("\t");
 71  0
         out.print("");
 72  0
         out.print("\t");
 73  0
         out.print(messageStructure.getXmlObject());
 74  0
         out.print("\t");
 75  0
         out.print(messageStructure.getShortName());
 76  0
         out.print("\t");
 77  0
         out.print(messageStructure.getName());
 78  0
         out.print("\t");
 79  0
         out.print(messageStructure.getType());
 80  0
         out.print("\t");
 81  0
         out.print(clean(messageStructure.getDescription()));
 82  0
         out.print("\t");
 83  0
         out.print(messageStructure.getRequired());
 84  0
         out.print("\t");
 85  0
         out.print(messageStructure.getCardinality());
 86  0
         out.print("\t");
 87  0
         out.print(messageStructure.getXmlAttribute());
 88  0
         out.print("\t");
 89  0
         out.print(messageStructure.getStatus());
 90  0
         out.print("\t");
 91  0
         out.print(messageStructure.getImplNotes());
 92  0
         out.println("");
 93  0
     }
 94  
 }