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  
 
 18  
  private MessageStructure messageStructure;
 19  
  private PrintStream out;
 20  
 
 21  
  public MessageStructureDumper (MessageStructure messageStructure,
 22  
                                 PrintStream out)
 23  0
  {
 24  0
   this.messageStructure = messageStructure;
 25  0
   this.out = out;
 26  0
  }
 27  
 
 28  
  public void dump ()
 29  
  {
 30  0
   out.println (
 31  
    messageStructure.getXmlObject () + "." + messageStructure.getShortName ()
 32  
    + " - " + messageStructure.getName () + " - " + messageStructure.getType ()
 33  
    + " http:XXX" + messageStructure.getUrl () + " - " + messageStructure.
 34  
    getDescription ());
 35  0
  }
 36  
 
 37  
  public void writeTabbedHeader ()
 38  
  {
 39  0
   out.print ("id");
 40  0
   out.print ("\t");
 41  0
   out.print ("Action");
 42  0
   out.print ("\t");
 43  0
   out.print ("xmlObject");
 44  0
   out.print ("\t");
 45  0
   out.print ("ShortName");
 46  0
   out.print ("\t");
 47  0
   out.print ("Name");
 48  0
   out.print ("\t");
 49  0
   out.print ("Type");
 50  0
   out.print ("\t");
 51  0
   out.print ("Description");
 52  0
   out.print ("\t");
 53  0
   out.print ("Required");
 54  0
   out.print ("\t");
 55  0
   out.print ("Cardinality");
 56  0
   out.print ("\t");
 57  0
   out.print ("XMLAttribute");
 58  0
   out.print ("\t");
 59  0
   out.print ("Status");
 60  0
   out.print ("\t");
 61  0
   out.print ("Feedback");
 62  0
   out.println ("");
 63  0
  }
 64  
 
 65  
  private String clean (String str)
 66  
  {
 67  0
   str = str.replace ("\n", " ");
 68  0
   str = str.replace ("\t", " ");
 69  0
   str = str.replace ("\r", str);
 70  0
   str = str.replace ("\f", " ");
 71  0
   return str;
 72  
  }
 73  
 
 74  
  public void writeTabbedData ()
 75  
  {
 76  0
   out.print (messageStructure.getId ());
 77  0
   out.print ("\t");
 78  0
   out.print ("");
 79  0
   out.print ("\t");
 80  0
   out.print (messageStructure.getXmlObject ());
 81  0
   out.print ("\t");
 82  0
   out.print (messageStructure.getShortName ());
 83  0
   out.print ("\t");
 84  0
   out.print (messageStructure.getName ());
 85  0
   out.print ("\t");
 86  0
   out.print (messageStructure.getType ());
 87  0
   out.print ("\t");
 88  0
   out.print (clean (messageStructure.getDescription ()));
 89  0
   out.print ("\t");
 90  0
   out.print (messageStructure.getRequired ());
 91  0
   out.print ("\t");
 92  0
   out.print (messageStructure.getCardinality ());
 93  0
   out.print ("\t");
 94  0
   out.print (messageStructure.getXmlAttribute ());
 95  0
   out.print ("\t");
 96  0
   out.print (messageStructure.getStatus ());
 97  0
   out.print ("\t");
 98  0
   out.print (messageStructure.getFeedback ());
 99  0
   out.println ("");
 100  0
  }
 101  
 
 102  
 }