KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icesoft > faces > application > ProductInfo


1 package com.icesoft.faces.application;
2
3 public class ProductInfo {
4
5     /**
6      * The company that owns this product.
7      */

8     public static String JavaDoc COMPANY = "@company@";
9
10     /**
11      * The name of the product.
12      */

13     public static String JavaDoc PRODUCT = "@product@";
14
15     /**
16      * The 3 levels of version identification, e.g. 1.0.0.
17      */

18     public static String JavaDoc PRIMARY = "@version.primary@";
19     public static String JavaDoc SECONDARY = "@version.secondary@";
20     public static String JavaDoc TERTIARY = "@version.tertiary@";
21
22     /**
23      * The release type of the product (alpha, beta, production).
24      */

25     public static String JavaDoc RELEASE_TYPE = "@release.type@";
26
27     /**
28      * The build number. Typically this would be tracked and maintained
29      * by the build system (i.e. Ant).
30      */

31     public static String JavaDoc BUILD_NO = "@build.number@";
32
33     /**
34      * The revision number retrieved from the repository for this build.
35      * This is substitued automatically by subversion.
36      */

37     public static String JavaDoc REVISION = "@revision@";
38
39     /**
40      * Convenience method to get all the relevant product information.
41      * @return
42      */

43     public String JavaDoc toString(){
44         StringBuffer JavaDoc info = new StringBuffer JavaDoc();
45         info.append( "\n" );
46         info.append( COMPANY );
47         info.append( "\n" );
48         info.append( PRODUCT );
49         info.append( " " );
50         info.append( PRIMARY );
51         info.append( "." );
52         info.append( SECONDARY );
53         info.append( "." );
54         info.append( TERTIARY );
55         info.append( " " );
56         info.append( RELEASE_TYPE );
57         info.append( "\n" );
58         info.append( "Build number: " );
59         info.append( BUILD_NO );
60         info.append( "\n" );
61         info.append( "Revision: " );
62         info.append( REVISION );
63         info.append( "\n" );
64         return info.toString();
65     }
66
67     public static void main(String JavaDoc[] args) {
68         ProductInfo app = new ProductInfo();
69         System.out.println( app.toString() );
70     }
71
72 }
73
Popular Tags