2 Launch4j (http://launch4j.sourceforge.net/)
3 Cross-platform Java application wrapper for creating Windows native executables.
5 Copyright (C) 2004, 2006 Grzegorz Kowal
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.
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.
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
23 * Created on May 21, 2005
25 package net.sf.launch4j.config;
27 import net.sf.launch4j.binding.IValidatable;
28 import net.sf.launch4j.binding.Validator;
31 * @author Copyright (C) 2005 Grzegorz Kowal
33 public class VersionInfo implements IValidatable {
34 public static final String VERSION_PATTERN = "(\\d+\\.){3}\\d+"; //$NON-NLS-1$
35 private static final int MAX_LEN = 150;
37 private String fileVersion;
38 private String txtFileVersion;
39 private String fileDescription;
40 private String copyright;
41 private String productVersion;
42 private String txtProductVersion;
43 private String productName;
44 private String companyName;
45 private String internalName;
46 private String originalFilename;
48 public void checkInvariants() {
49 Validator.checkString(fileVersion, 20, VERSION_PATTERN,
50 "versionInfo.fileVersion", Messages.getString("VersionInfo.file.version")); //$NON-NLS-1$ //$NON-NLS-2$
51 Validator.checkString(txtFileVersion, 50,
52 "versionInfo.txtFileVersion", Messages.getString("VersionInfo.txt.file.version")); //$NON-NLS-1$ //$NON-NLS-2$
53 Validator.checkString(fileDescription, MAX_LEN,
54 "versionInfo.fileDescription", Messages.getString("VersionInfo.file.description")); //$NON-NLS-1$ //$NON-NLS-2$
55 Validator.checkString(copyright, MAX_LEN,
56 "versionInfo.copyright", Messages.getString("VersionInfo.copyright")); //$NON-NLS-1$ //$NON-NLS-2$
57 Validator.checkString(productVersion, 20, VERSION_PATTERN,
58 "versionInfo.productVersion", Messages.getString("VersionInfo.product.version")); //$NON-NLS-1$ //$NON-NLS-2$
59 Validator.checkString(txtProductVersion, 50,
60 "versionInfo.txtProductVersion", Messages.getString("VersionInfo.txt.product.version")); //$NON-NLS-1$ //$NON-NLS-2$
61 Validator.checkString(productName, MAX_LEN,
62 "versionInfo.productName", Messages.getString("VersionInfo.product.name")); //$NON-NLS-1$ //$NON-NLS-2$
63 Validator.checkOptString(companyName, MAX_LEN,
64 "versionInfo.companyName", Messages.getString("VersionInfo.company.name")); //$NON-NLS-1$ //$NON-NLS-2$
65 Validator.checkString(internalName, 50,
66 "versionInfo.internalName", Messages.getString("VersionInfo.internal.name")); //$NON-NLS-1$ //$NON-NLS-2$
67 Validator.checkTrue(!internalName.endsWith(".exe"), //$NON-NLS-1$
68 "versionInfo.internalName", //$NON-NLS-1$
69 Messages.getString("VersionInfo.internal.name.not.exe")); //$NON-NLS-1$
70 Validator.checkString(originalFilename, 50,
71 "versionInfo.originalFilename", Messages.getString("VersionInfo.original.filename")); //$NON-NLS-1$ //$NON-NLS-2$
72 Validator.checkTrue(originalFilename.endsWith(".exe"), //$NON-NLS-1$
73 "versionInfo.originalFilename", //$NON-NLS-1$
74 Messages.getString("VersionInfo.original.filename.exe")); //$NON-NLS-1$
77 public String getCompanyName() {
81 public void setCompanyName(String companyName) {
82 this.companyName = companyName;
85 public String getCopyright() {
89 public void setCopyright(String copyright) {
90 this.copyright = copyright;
93 public String getFileDescription() {
94 return fileDescription;
97 public void setFileDescription(String fileDescription) {
98 this.fileDescription = fileDescription;
101 public String getFileVersion() {
105 public void setFileVersion(String fileVersion) {
106 this.fileVersion = fileVersion;
109 public String getInternalName() {
113 public void setInternalName(String internalName) {
114 this.internalName = internalName;
117 public String getOriginalFilename() {
118 return originalFilename;
121 public void setOriginalFilename(String originalFilename) {
122 this.originalFilename = originalFilename;
125 public String getProductName() {
129 public void setProductName(String productName) {
130 this.productName = productName;
133 public String getProductVersion() {
134 return productVersion;
137 public void setProductVersion(String productVersion) {
138 this.productVersion = productVersion;
141 public String getTxtFileVersion() {
142 return txtFileVersion;
145 public void setTxtFileVersion(String txtFileVersion) {
146 this.txtFileVersion = txtFileVersion;
149 public String getTxtProductVersion() {
150 return txtProductVersion;
153 public void setTxtProductVersion(String txtProductVersion) {
154 this.txtProductVersion = txtProductVersion;