001/** 002 * Copyright 2004-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016/* 017 * To change this template, choose Tools | Templates 018 * and open the template in the editor. 019 */ 020package org.kuali.student.contract.model.util; 021 022import java.io.PrintStream; 023 024import org.kuali.student.contract.model.Service; 025 026/** 027 * 028 * @author nwright 029 */ 030public class ServiceDumper { 031 032 private Service service; 033 private PrintStream out; 034 035 public ServiceDumper(Service service, PrintStream out) { 036 this.service = service; 037 this.out = out; 038 } 039 040 public void dump() { 041 out.println(service.getKey() + "." + service.getName() + "(" + service.getVersion() + ")"); 042 } 043 044 public void writeTabbedHeader() { 045 out.print("Key"); 046 out.print("\t"); 047 out.print("Name"); 048 out.print("\t"); 049 out.print("Version"); 050 out.print("\t"); 051 out.print("url"); 052 out.print("\t"); 053 out.print("ImplProject"); 054 out.print("\t"); 055 out.print("status"); 056 out.print("\t"); 057 out.print("comments"); 058 out.println(""); 059 } 060 061 public void writeTabbedData() { 062 out.print(service.getKey()); 063 out.print("\t"); 064 out.print(service.getName()); 065 out.print("\t"); 066 out.print(service.getVersion()); 067 out.print("\t"); 068 out.print(service.getUrl()); 069 out.print("\t"); 070 out.print(service.getImplProject()); 071 out.print("\t"); 072 out.print(service.getStatus()); 073 out.print("\t"); 074 out.print(service.getComments()); 075 out.println(""); 076 } 077}