KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > idaremedia > antx > BuildInfo


1 /**
2  * $Id: BuildInfo.java,in 187 2007-03-25 17:59:16Z ssmc $
3  * Copyright 2003,2007 iDare Media, Inc. All rights reserved.
4  *
5  * Originally written by iDare Media, Inc. for release into the public domain. This
6  * library, source form and binary form, is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public License as published by the
8  * Free Software Foundation; either version 2 of the License, or (at your option) any later
9  * version.<p>
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU LGPL (GNU Lesser General Public License) for more details.<p>
14  *
15  * You should have received a copy of the GNU Lesser General Public License along with this
16  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite
17  * 330, Boston, MA 02111-1307 USA. The LGPL can be found online at
18  * http://www.fsf.org/copyleft/lesser.html<p>
19  *
20  * This product has been influenced by several projects within the open-source community.
21  * The JWare developers wish to acknowledge the open-source community's support. For more
22  * information regarding the open-source products used within JWare, please visit the
23  * JWare website.
24  *----------------------------------------------------------------------------------------*
25  * WEBSITE- http://antxtras.sf.net/ EMAIL- jware[at]users[dot]sourceforge[dot]net
26  *----------------------------------------------------------------------------------------*
27  **/

28
29 package com.idaremedia.antx;
30
31 import java.io.Serializable JavaDoc;
32
33 import com.idaremedia.apis.Buildstrs;
34
35 /**
36  * Build information that describes this release of the JWare/AntX product.
37  *
38  * @since JWare/AntX 0.1
39  * @author ssmc, &copy;2003,2007 <a HREF="http://www.jware.info">iDare&nbsp;Media,&nbsp;Inc.</a>
40  * @version 0.5.1
41  * @.safety multiple
42  * @.group impl,infra
43  **/

44
45 public final class BuildInfo implements Buildstrs, Serializable JavaDoc, Cloneable JavaDoc
46 {
47     /**
48      * Initializes a new BuildInfo instance based on
49      * runtime generated values.
50      **/

51     public BuildInfo()
52     {
53     }
54
55
56     /**
57      * Returns diagnostics id for build; always "<code>AntX</code>".
58      **/

59     public final String JavaDoc getID()
60     {
61         return "AntX";
62     }
63
64
65     /**
66      * Returns displayable for build, for example
67      * "<code>iDare Media's JWare/AntX source</code>".
68      **/

69     public final String JavaDoc getDisplayName()
70     {
71         return "iDare Media's AntXtras/Foundation, v0.5.1_build33, Mar-25-2007";
72     }
73
74
75     /**
76      * Returns product version for this build, for example
77      * "<code>1&#46;0b3</code>."
78      **/

79     public final String JavaDoc getVersion()
80     {
81         return "0.5.1";
82     }
83
84
85     /**
86      * Returns this build's (unique) identifer, for example
87      * "<code>1&#46;0b3_build123</code>."
88      **/

89     public final String JavaDoc getBuildVersion()
90     {
91         return "0.5.1_build33";
92     }
93
94
95     /**
96      * Returns the product shorthand namespace prefix, for example
97      * "<code>jware&#46;</code>".
98      **/

99     public final String JavaDoc getNSPrefix()
100     {
101         return "jw.antx";
102     }
103
104
105     /**
106      * Returns the product namespace URI, for example
107      * "<code>http://www&#46;jware&#46;info/jwf-xmlschema</code>".
108      **/

109     public final String JavaDoc getNSURI()
110     {
111         return "http://antxtras.sf.net/";
112     }
113
114
115     /**
116      * Returns the product properties namespace prefix, for example
117      * "<code>PET</code>" as used in
118      * "<code>PET&#46;repository&#46;filesystem&#46;root</code>."
119      **/

120     public final String JavaDoc getPropertiesPrefix()
121     {
122         return "jware.antx.";
123     }
124
125
126     /**
127      * Returns date of build in an abbreviated format, for example
128      * "<code>Jan012001,12:34GMT</code>".
129      **/

130     public final String JavaDoc getAbbrDate()
131     {
132         return "Mar-25-2007";
133     }
134
135
136     /**
137      * Returns date of build in a verbose format, for example
138      * "<code>Monday 1 January 2001, 12:34:34 GMT</code>".
139      **/

140     public final String JavaDoc getLongDate()
141     {
142         return "Mar252007_232831GMT";
143     }
144
145
146     /**
147      * Returns OS on which build generated, for example
148      * "<code>RedHat Linux 6&#46;1 (patch03)</code>".
149      **/

150     public final String JavaDoc getOS()
151     {
152         return "Windows XP 5.1";
153     }
154
155
156     /**
157      * Returns build builder's (system) identifier, for example
158      * "<code>buildmaster</code>".
159      **/

160     public final String JavaDoc getBuilderID()
161     {
162         return "ssmc";
163     }
164
165
166     /**
167      * Returns build builder's common name, for example
168      * "<code>Robert Jenson</code>".
169      **/

170     public final String JavaDoc getBuilderCN()
171     {
172         return "buildmeister";
173     }
174
175
176     /**
177      * Returns host information for machine used for build, for example
178      * "<code>buildbox1</code>".
179      **/

180     public final String JavaDoc getHostID()
181     {
182         return "milo";
183     }
184
185
186     /**
187      * Returns various paths used to generate build (class,libs,etc.);
188      * optional.
189      **/

190     public final String JavaDoc getUsedPaths()
191     {
192         return "Undeclared";
193     }
194
195
196     /**
197      * Determines if this buildstrs is equal to given object&#150; which has
198      * to be another BuildInfo instance.
199      **/

200     public boolean equals(Object JavaDoc o)
201     {
202         if (o==null) {
203             return false;
204         }
205         if (o==this || o.getClass()==com.idaremedia.antx.BuildInfo.class) {
206             return true;
207         }
208         return false;
209     }
210
211
212     /**
213      * Returns a hash value for this object. Since all instances of this
214      * class are considered equal, the hash value depends on the class's id.
215      **/

216     public int hashCode()
217     {
218         return HASH_;
219     }
220
221
222     /**
223      * Returns clone of this object.
224      **/

225     public Object JavaDoc clone()
226     {
227         try {
228             return super.clone();
229         } catch(CloneNotSupportedException JavaDoc clnx) {
230             throw new InternalError JavaDoc("Clone broken");
231         }
232     }
233
234
235     /**
236      * Returns a VM-shareable singleton reference.
237      * @.safety guarded
238      **/

239     public static synchronized Buildstrs getInstance()
240     {
241         if (sm_Instance==null) {
242             sm_Instance= new com.idaremedia.antx.BuildInfo();
243         }
244         return sm_Instance;
245     }
246
247
248     private static final int HASH_= BuildInfo.class.getName().hashCode();
249     private static Buildstrs sm_Instance=null;
250 }
251
252 /* end-of-BuildInfo.java */
253
Popular Tags