View Javadoc

1   /**
2    * Copyright 2004-2013 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.opensource.org/licenses/ecl2.php
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  /*
17   * To change this template, choose Tools | Templates
18   * and open the template in the editor.
19   */
20  package org.kuali.student.contract.model.util;
21  
22  import java.io.PrintStream;
23  
24  import org.kuali.student.contract.model.Service;
25  
26  /**
27   *
28   * @author nwright
29   */
30  public class ServiceDumper {
31  
32      private Service service;
33      private PrintStream out;
34  
35      public ServiceDumper(Service service, PrintStream out) {
36          this.service = service;
37          this.out = out;
38      }
39  
40      public void dump() {
41          out.println(service.getKey() + "." + service.getName() + "(" + service.getVersion() + ")");
42      }
43  
44      public void writeTabbedHeader() {
45          out.print("Key");
46          out.print("\t");
47          out.print("Name");
48          out.print("\t");
49          out.print("Version");
50          out.print("\t");
51          out.print("url");
52          out.print("\t");
53          out.print("ImplProject");
54          out.print("\t");
55          out.print("status");
56          out.print("\t");
57          out.print("comments");
58          out.println("");
59      }
60  
61      public void writeTabbedData() {
62          out.print(service.getKey());
63          out.print("\t");
64          out.print(service.getName());
65          out.print("\t");
66          out.print(service.getVersion());
67          out.print("\t");
68          out.print(service.getUrl());
69          out.print("\t");
70          out.print(service.getImplProject());
71          out.print("\t");
72          out.print(service.getStatus());
73          out.print("\t");
74          out.print(service.getComments());
75          out.println("");
76      }
77  }