KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > firstpartners > nounit > ui > common > CommandPackage


1 package net.firstpartners.nounit.ui.common;
2
3 /**
4  * Title: NoUnit - Identify Classes that are not being unit Tested
5  *
6  * Copyright (C) 2001 Paul Browne , FirstPartners.net
7  *
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * @author Paul Browne
24  * @version 0.7
25  */

26
27
28 /**
29  * Holds all the relevant information from Command Line / Gui so that the
30  * bulk of the system does not have to use these objects. <BR>
31  * Enables system to be developed and run independently as Command_line,
32  * Gui , Web Server etc<BR>
33  * The naming convention is that any constant beginning with "KEY..."
34  */

35 public class CommandPackage extends AbstractPackage {
36
37   /**
38    * Start directory (Base Directory of Project)
39    */

40   public static final String JavaDoc START_DIR="start_dir";
41   
42   /**
43    * Output directory
44    */

45   public static final String JavaDoc OUTPUT_DIR="output_dir";
46   
47   /**
48    * Report Class
49    */

50   public static final String JavaDoc REPORT_CLASS="report_class";
51   
52   /**
53    * Message to be shown to the user
54    */

55   public static final String JavaDoc USER_MESSAGE="user_message";
56   
57   
58   public static final String JavaDoc XML_OUTPUT_NAME="xml_output_name";
59     
60   /**
61    * Default constructor
62    */

63   public CommandPackage() {
64     super();
65   }
66
67   /**
68    * Constructor that adds an Array of Value pairs , after initialising with defaults.
69    * <BR> Package Level Access - Factory method in this package should call!!
70    * @param inValues - Array to add to Value pairs e.g. key1 , value1, key2 , value2
71    * @exception NoUnitException if Values are incompatible with what needs to be stored
72    */

73
74   public CommandPackage(String JavaDoc[] inValues) {
75     //Create the new Internal Store etc by calling default constructor
76
this();
77
78     //Call the addvalues method
79
this.addValues(inValues);
80   }
81
82
83
84   /**
85    * Overridden toString function to provide summary of info held in this class
86    *
87    * @return String description of internal values
88    */

89   public String JavaDoc toString() {
90
91       //Get parent's String
92
StringBuffer JavaDoc stringBuffer = new StringBuffer JavaDoc(super.toString());
93     stringBuffer.append("\n");
94
95     //Add Values Specific to this Class
96

97
98     //Convert and return
99
return stringBuffer.toString();
100   }
101
102 }
Popular Tags