KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > launch4j > config > VersionInfo


1 /*
2     Launch4j (http://launch4j.sourceforge.net/)
3     Cross-platform Java application wrapper for creating Windows native executables.
4
5     Copyright (C) 2004, 2006 Grzegorz Kowal
6
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */

21
22 /*
23  * Created on May 21, 2005
24  */

25 package net.sf.launch4j.config;
26
27 import net.sf.launch4j.binding.IValidatable;
28 import net.sf.launch4j.binding.Validator;
29
30 /**
31  * @author Copyright (C) 2005 Grzegorz Kowal
32  */

33 public class VersionInfo implements IValidatable {
34     public static final String JavaDoc VERSION_PATTERN = "(\\d+\\.){3}\\d+";
35
36     private String JavaDoc fileVersion;
37     private String JavaDoc txtFileVersion;
38     private String JavaDoc fileDescription;
39     private String JavaDoc copyright;
40     private String JavaDoc productVersion;
41     private String JavaDoc txtProductVersion;
42     private String JavaDoc productName;
43     private String JavaDoc companyName;
44     private String JavaDoc internalName;
45     private String JavaDoc originalFilename;
46
47     public void checkInvariants() {
48         Validator.checkString(fileVersion, 20, VERSION_PATTERN,
49                 "versionInfo.fileVersion",
50                 Messages.getString("VersionInfo.file.version"));
51         Validator.checkString(txtFileVersion, 50, "versionInfo.txtFileVersion",
52                 Messages.getString("VersionInfo.txt.file.version"));
53         Validator.checkString(fileDescription, 150, "versionInfo.fileDescription",
54                 Messages.getString("VersionInfo.file.description"));
55         Validator.checkString(copyright, 150, "versionInfo.copyright",
56                 Messages.getString("VersionInfo.copyright"));
57         Validator.checkString(productVersion, 20, VERSION_PATTERN,
58                 "versionInfo.productVersion",
59                 Messages.getString("VersionInfo.product.version"));
60         Validator.checkString(txtProductVersion, 50, "versionInfo.txtProductVersion",
61                 Messages.getString("VersionInfo.txt.product.version"));
62         Validator.checkString(productName, 150, "versionInfo.productName",
63                 Messages.getString("VersionInfo.product.name"));
64         Validator.checkOptString(companyName, 150, "versionInfo.companyName",
65                 Messages.getString("VersionInfo.company.name"));
66         Validator.checkString(internalName, 50, "versionInfo.internalName",
67                 Messages.getString("VersionInfo.internal.name"));
68         Validator.checkTrue(!internalName.endsWith(".exe"), "versionInfo.internalName",
69                 Messages.getString("VersionInfo.internal.name.not.exe"));
70         Validator.checkString(originalFilename, 50, "versionInfo.originalFilename",
71                 Messages.getString("VersionInfo.original.filename"));
72         Validator.checkTrue(originalFilename.endsWith(".exe"),
73                 "versionInfo.originalFilename",
74                 Messages.getString("VersionInfo.original.filename.exe"));
75     }
76
77     public String JavaDoc getCompanyName() {
78         return companyName;
79     }
80
81     public void setCompanyName(String JavaDoc companyName) {
82         this.companyName = companyName;
83     }
84
85     public String JavaDoc getCopyright() {
86         return copyright;
87     }
88
89     public void setCopyright(String JavaDoc copyright) {
90         this.copyright = copyright;
91     }
92
93     public String JavaDoc getFileDescription() {
94         return fileDescription;
95     }
96
97     public void setFileDescription(String JavaDoc fileDescription) {
98         this.fileDescription = fileDescription;
99     }
100
101     public String JavaDoc getFileVersion() {
102         return fileVersion;
103     }
104
105     public void setFileVersion(String JavaDoc fileVersion) {
106         this.fileVersion = fileVersion;
107     }
108
109     public String JavaDoc getInternalName() {
110         return internalName;
111     }
112
113     public void setInternalName(String JavaDoc internalName) {
114         this.internalName = internalName;
115     }
116
117     public String JavaDoc getOriginalFilename() {
118         return originalFilename;
119     }
120
121     public void setOriginalFilename(String JavaDoc originalFilename) {
122         this.originalFilename = originalFilename;
123     }
124
125     public String JavaDoc getProductName() {
126         return productName;
127     }
128
129     public void setProductName(String JavaDoc productName) {
130         this.productName = productName;
131     }
132
133     public String JavaDoc getProductVersion() {
134         return productVersion;
135     }
136
137     public void setProductVersion(String JavaDoc productVersion) {
138         this.productVersion = productVersion;
139     }
140
141     public String JavaDoc getTxtFileVersion() {
142         return txtFileVersion;
143     }
144
145     public void setTxtFileVersion(String JavaDoc txtFileVersion) {
146         this.txtFileVersion = txtFileVersion;
147     }
148
149     public String JavaDoc getTxtProductVersion() {
150         return txtProductVersion;
151     }
152
153     public void setTxtProductVersion(String JavaDoc txtProductVersion) {
154         this.txtProductVersion = txtProductVersion;
155     }
156 }
157
Popular Tags