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.
19 * $Id: Version.java 477252 2006-11-20 16:52:00Z minchau $
21 package org.apache.xml.serializer;
24 * Administrative class to keep track of the version number of
25 * the Serializer release.
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.</P>
31 public final class Version
35 * Get the basic version string for the current Serializer.
36 * Version String formatted like
37 * <CODE>"<B>Serializer</B> <B>Java</B> v.r[.dd| <B>D</B>nn]"</CODE>.
39 * Futurework: have this read version info from jar manifest.
41 * @return String denoting our current version
43 public static String getVersion()
45 return getProduct()+" "+getImplementationLanguage()+" "
46 +getMajorVersionNum()+"."+getReleaseVersionNum()+"."
47 +( (getDevelopmentVersionNum() > 0) ?
48 ("D"+getDevelopmentVersionNum()) : (""+getMaintenanceVersionNum()));
52 * Print the processor version to the command line.
54 * @param argv command line arguments, unused.
56 public static void main(String argv[])
58 System.out.println(getVersion());
62 * Name of product: Serializer.
64 public static String getProduct()
70 * Implementation Language: Java.
72 public static String getImplementationLanguage()
79 * Major version number.
80 * Version number. This changes only when there is a
81 * significant, externally apparent enhancement from
82 * the previous release. 'n' represents the n'th
85 * Clients should carefully consider the implications
86 * of new versions as external interfaces and behaviour
89 public static int getMajorVersionNum()
97 * Release number. This changes when:
98 * - a new set of functionality is to be added, eg,
99 * implementation of a new W3C specification.
100 * - API or behaviour change.
101 * - its designated as a reference release.
103 public static int getReleaseVersionNum()
109 * Maintenance Drop Number.
110 * Optional identifier used to designate maintenance
111 * drop applied to a specific release and contains
112 * fixes for defects reported. It maintains compatibility
113 * with the release and contains no API changes.
114 * When missing, it designates the final and complete
115 * development drop for a release.
117 public static int getMaintenanceVersionNum()
123 * Development Drop Number.
124 * Optional identifier designates development drop of
125 * a specific release. D01 is the first development drop
128 * Development drops are works in progress towards a
129 * compeleted, final release. A specific development drop
130 * may not completely implement all aspects of a new
131 * feature, which may take several development drops to
132 * complete. At the point of the final drop for the
133 * release, the D suffix will be omitted.
135 * Each 'D' drops can contain functional enhancements as
136 * well as defect fixes. 'D' drops may not be as stable as
137 * the final releases.
139 public static int getDevelopmentVersionNum()
142 if ((new String("")).length() == 0)
145 return Integer.parseInt("");
146 } catch (NumberFormatException nfe) {