1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.xmlhammer;
23
24 /***
25 * The version and name of the Xngr browser application.
26 *
27 * Sets 6 System-properties for general use:<br/>
28 * <code>xngr.title</code><br/>
29 * <code>xngr.vendor</code><br/>
30 * <code>xngr.reference</code><br/>
31 * <code>xngr.version</code><br/>
32 * <code>xngr.description</code><br/>
33 * <code>xngr.copyright</code><br/>
34 *
35 * @version $Revision$, $Date$
36 * @author Edwin Dankert <edankert@cladonia.com>
37 */
38 public class Identity {
39 private static Identity identity = null;
40
41 public static final String TITLE_PROPERTY = "product.title";
42 public static final String VENDOR_PROPERTY = "product.vendor";
43 public static final String REFERENCE_PROPERTY = "product.reference";
44 public static final String VERSION_PROPERTY = "product.version";
45 public static final String DESCRIPTION_PROPERTY = "product.description";
46 public static final String COPYRIGHT_PROPERTY = "product.copyright";
47
48 /***
49 * Gets the one version of the identity.
50 */
51 public static Identity getInstance() {
52 if ( identity == null) {
53 identity = new Identity();
54 }
55
56 return identity;
57 }
58
59 /***
60 * Sets the identity of the application as System properties...
61 */
62 private Identity() {
63 System.setProperty( TITLE_PROPERTY, "XML Hammer");
64 System.setProperty( VENDOR_PROPERTY, "Edwin Dankert");
65 System.setProperty( REFERENCE_PROPERTY, "http://www.xmlhammer.org/");
66 System.setProperty( VERSION_PROPERTY, "1.0");
67 System.setProperty( DESCRIPTION_PROPERTY, "When the only thing you've got is a XML Hammer...");
68 System.setProperty( COPYRIGHT_PROPERTY, "Copyright 2005 - 2008 (C) Edwin Dankert");
69 }
70
71 /***
72 * Gets the product's title.
73 */
74 public String getTitle() {
75 return System.getProperty( TITLE_PROPERTY);
76 }
77
78 /***
79 * Gets the vendor's name.
80 */
81 public String getVendor() {
82 return System.getProperty( VENDOR_PROPERTY);
83 }
84
85 /***
86 * Gets a reference, ie. the products home page.
87 */
88 public String getReference() {
89 return System.getProperty( REFERENCE_PROPERTY);
90 }
91
92
93 /***
94 * Gets the version number for the product.
95 */
96 public String getVersion() {
97 return System.getProperty( VERSION_PROPERTY);
98 }
99
100 /***
101 * Gets a description for the product.
102 */
103 public String getDescription() {
104 return System.getProperty( DESCRIPTION_PROPERTY);
105 }
106
107 /***
108 * Gets the copyright information for the product.
109 */
110 public String getCopyright() {
111 return System.getProperty( COPYRIGHT_PROPERTY);
112 }
113 }