2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the "License");
7
* you may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS,
14
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
* See the License for the specific language governing permissions and
16
* limitations under the License.
21
package org.apache.xalan;
24
* Administrative class to keep track of the version number of
26
* <P>This class implements the upcoming standard of having
27
* org.apache.project-name.Version.getVersion() be a standard way
28
* to get version information. This class will replace the older
29
* org.apache.xalan.processor.Version class.</P>
30
* <P>See also: org/apache/xalan/res/XSLTInfo.properties for
31
* information about the version of the XSLT spec we support.</P>
38
* Get the basic version string for the current Xalan release.
39
* Version String formatted like
40
* <CODE>"<B>Xalan</B> <B>Java</B> v.r[.dd| <B>D</B>nn]"</CODE>.
42
* Futurework: have this read version info from jar manifest.
44
* @return String denoting our current version
46
public static String getVersion()
48
return getProduct()+" "+getImplementationLanguage()+" "
49
+getMajorVersionNum()+"."+getReleaseVersionNum()+"."
50
+( (getDevelopmentVersionNum() > 0) ?
51
("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum()));
55
* Print the processor version to the command line.
57
* @param argv command line arguments, unused.
59
public static void main(String argv[])
61
System.out.println(getVersion());
65
* Name of product: Xalan.
67
public static String getProduct()
73
* Implementation Language: Java.
75
public static String getImplementationLanguage()
82
* Major version number.
83
* Version number. This changes only when there is a
84
* significant, externally apparent enhancement from
85
* the previous release. 'n' represents the n'th
88
* Clients should carefully consider the implications
89
* of new versions as external interfaces and behaviour
92
public static int getMajorVersionNum()
94
return @version.VERSION@;
100
* Release number. This changes when:
101
* - a new set of functionality is to be added, eg,
102
* implementation of a new W3C specification.
103
* - API or behaviour change.
104
* - its designated as a reference release.
106
public static int getReleaseVersionNum()
108
return @version.RELEASE@;
112
* Maintenance Drop Number.
113
* Optional identifier used to designate maintenance
114
* drop applied to a specific release and contains
115
* fixes for defects reported. It maintains compatibility
116
* with the release and contains no API changes.
117
* When missing, it designates the final and complete
118
* development drop for a release.
120
public static int getMaintenanceVersionNum()
122
return @version.MINOR@;
126
* Development Drop Number.
127
* Optional identifier designates development drop of
128
* a specific release. D01 is the first development drop
131
* Development drops are works in progress towards a
132
* compeleted, final release. A specific development drop
133
* may not completely implement all aspects of a new
134
* feature, which may take several development drops to
135
* complete. At the point of the final drop for the
136
* release, the D suffix will be omitted.
138
* Each 'D' drops can contain functional enhancements as
139
* well as defect fixes. 'D' drops may not be as stable as
140
* the final releases.
142
public static int getDevelopmentVersionNum()
145
if ((new String("@version.DEVELOPER@")).length() == 0)
148
return Integer.parseInt("@version.DEVELOPER@");
149
} catch (NumberFormatException nfe) {