KickJava   Java API By Example, From Geeks To Geeks.

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


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 1, 2006
24  */

25 package net.sf.launch4j.config;
26
27 import java.util.List JavaDoc;
28
29 import net.sf.launch4j.binding.IValidatable;
30 import net.sf.launch4j.binding.Validator;
31
32 /**
33  * @author Copyright (C) 2006 Grzegorz Kowal
34  */

35 public class ClassPath implements IValidatable {
36     private String JavaDoc mainClass;
37     private List JavaDoc paths;
38
39     public void checkInvariants() {
40         Validator.checkString(mainClass, Validator.MAX_PATH, "mainClass",
41                 Messages.getString("ClassPath.mainClass"));
42         Validator.checkOptStrings(paths,
43                 Validator.MAX_PATH,
44                 Validator.MAX_BIG_STR,
45                 "paths",
46                 Messages.getString("ClassPath.path"));
47     }
48
49     public String JavaDoc getMainClass() {
50         return mainClass;
51     }
52
53     public void setMainClass(String JavaDoc mainClass) {
54         this.mainClass = mainClass;
55     }
56
57     public List JavaDoc getPaths() {
58         return paths;
59     }
60
61     public void setPaths(List JavaDoc paths) {
62         this.paths = paths;
63     }
64
65     public String JavaDoc getPathsString() {
66         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
67         for (int i = 0; i < paths.size(); i++) {
68             sb.append(paths.get(i));
69             if (i < paths.size() - 1) {
70                 sb.append(';');
71             }
72         }
73         return sb.toString();
74     }
75 }
76
Popular Tags