001    /*
002     * To change this template, choose Tools | Templates
003     * and open the template in the editor.
004     */
005    package org.kuali.student.contract.model.util;
006    
007    import java.io.PrintStream;
008    
009    import org.kuali.student.contract.model.Service;
010    
011    /**
012     *
013     * @author nwright
014     */
015    public class ServiceDumper {
016    
017        private Service service;
018        private PrintStream out;
019    
020        public ServiceDumper(Service service, PrintStream out) {
021            this.service = service;
022            this.out = out;
023        }
024    
025        public void dump() {
026            out.println(service.getKey() + "." + service.getName() + "(" + service.getVersion() + ")");
027        }
028    
029        public void writeTabbedHeader() {
030            out.print("Key");
031            out.print("\t");
032            out.print("Name");
033            out.print("\t");
034            out.print("Version");
035            out.print("\t");
036            out.print("url");
037            out.print("\t");
038            out.print("ImplProject");
039            out.print("\t");
040            out.print("status");
041            out.print("\t");
042            out.print("comments");
043            out.println("");
044        }
045    
046        public void writeTabbedData() {
047            out.print(service.getKey());
048            out.print("\t");
049            out.print(service.getName());
050            out.print("\t");
051            out.print(service.getVersion());
052            out.print("\t");
053            out.print(service.getUrl());
054            out.print("\t");
055            out.print(service.getImplProject());
056            out.print("\t");
057            out.print(service.getStatus());
058            out.print("\t");
059            out.print(service.getComments());
060            out.println("");
061        }
062    }