KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > Version


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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 package org.apache.taglibs.standard;
18
19 /**
20  * [lifted from xalan]
21  * <meta name="usage" content="general"/>
22  * Administrative class to keep track of the version number of
23  * the standard tag library.
24  * <P>This class implements the upcoming standard of having
25  * org.apache.project-name.Version.getVersion() be a standard way
26  * to get version information.
27  */

28 public class Version
29 {
30   /**
31    * Get the basic version string for the current release.
32    * Version String formatted like
33    * <CODE>"<B>standard-taglib</B> v.r[.dd| <B>D</B>nn]"</CODE>.
34    *
35    * Futurework: have this read version info from jar manifest.
36    *
37    * @return String denoting our current version
38    */

39   public static String JavaDoc getVersion()
40   {
41     return getProduct() + " " +
42            getMajorVersionNum() + "." + getReleaseVersionNum()+ "." +
43            getMaintenanceVersionNum() +
44            ((getDevelopmentVersionNum() > 0) ?
45                ("_D" + getDevelopmentVersionNum()) : "");
46   }
47
48   /**
49    * Print the processor version to the command line.
50    *
51    * @param argv command line arguments, unused.
52    */

53   public static void main(String JavaDoc argv[])
54   {
55     System.out.println(getVersion());
56   }
57
58   /**
59    * Name of product
60    */

61   public static String JavaDoc getProduct()
62   {
63     return "standard-taglib";
64   }
65
66   /**
67    * Major version number.
68    * Version number. This changes only when there is a
69    * significant, externally apparent enhancement from
70    * the previous release. 'n' represents the n'th
71    * version.
72    *
73    * Clients should carefully consider the implications
74    * of new versions as external interfaces and behaviour
75    * may have changed.
76    */

77   public static int getMajorVersionNum()
78   {
79       return 1;
80   }
81
82   /**
83    * Release Number.
84    * Release number. This changes when:
85    * - a new set of functionality is to be added, eg,
86    * implementation of a new W3C specification.
87    * - API or behaviour change.
88    * - its designated as a reference release.
89    */

90   public static int getReleaseVersionNum()
91   {
92     return 1;
93   }
94
95   /**
96    * Maintenance Drop Number.
97    * Optional identifier used to designate maintenance
98    * drop applied to a specific release and contains
99    * fixes for defects reported. It maintains compatibility
100    * with the release and contains no API changes.
101    * When missing, it designates the final and complete
102    * development drop for a release.
103    */

104   public static int getMaintenanceVersionNum()
105   {
106     return 2;
107   }
108
109   /**
110    * Development Drop Number.
111    * Optional identifier designates development drop of
112    * a specific release. D01 is the first development drop
113    * of a new release.
114    *
115    * Development drops are works in progress towards a
116    * compeleted, final release. A specific development drop
117    * may not completely implement all aspects of a new
118    * feature, which may take several development drops to
119    * complete. At the point of the final drop for the
120    * release, the D suffix will be omitted.
121    *
122    * Each 'D' drops can contain functional enhancements as
123    * well as defect fixes. 'D' drops may not be as stable as
124    * the final releases.
125    */

126   public static int getDevelopmentVersionNum()
127   {
128     return 0;
129   }
130 }
131
Popular Tags